Skip to content

Commit 2528ff0

Browse files
committed
Merge branch 'js/windows-open-eisdir-error'
* js/windows-open-eisdir-error: Windows: correct detection of EISDIR in mingw_open()
2 parents 9b144d8 + ba6fad0 commit 2528ff0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compat/mingw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ int mingw_open (const char *filename, int oflags, ...)
312312
return -1;
313313
fd = _wopen(wfilename, oflags, mode);
314314

315-
if (fd < 0 && (oflags & O_CREAT) && errno == EACCES) {
315+
if (fd < 0 && (oflags & O_ACCMODE) != O_RDONLY && errno == EACCES) {
316316
DWORD attrs = GetFileAttributesW(wfilename);
317317
if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY))
318318
errno = EISDIR;

0 commit comments

Comments
 (0)