mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
Merge branch 'js/windows-open-eisdir-error'
* js/windows-open-eisdir-error: Windows: correct detection of EISDIR in mingw_open()
This commit is contained in:
commit
2528ff079c
|
@ -312,7 +312,7 @@ int mingw_open (const char *filename, int oflags, ...)
|
|||
return -1;
|
||||
fd = _wopen(wfilename, oflags, mode);
|
||||
|
||||
if (fd < 0 && (oflags & O_CREAT) && errno == EACCES) {
|
||||
if (fd < 0 && (oflags & O_ACCMODE) != O_RDONLY && errno == EACCES) {
|
||||
DWORD attrs = GetFileAttributesW(wfilename);
|
||||
if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY))
|
||||
errno = EISDIR;
|
||||
|
|
Loading…
Reference in a new issue