Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'js/windows-open-eisdir-error' into maint
author
Junio C Hamano
<gitster@pobox.com>
Mon, 22 Dec 2014 20:17:13 +0000
(12:17 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 22 Dec 2014 20:17:13 +0000
(12:17 -0800)
open() emulated on Windows platforms did not give EISDIR upon an
attempt to open a directory for writing.
* js/windows-open-eisdir-error:
Windows: correct detection of EISDIR in mingw_open()
compat/mingw.c
patch
|
blob
|
history
raw
(from parent 1:
5d509d5
)
diff --git
a/compat/mingw.c
b/compat/mingw.c
index c5c37e53ce0fc534b1739a75c4abde0c67027d14..70f3191a4f19f10a156d1f2c054943d5147ab049 100644
(file)
--- a/
compat/mingw.c
+++ b/
compat/mingw.c
@@
-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;