summaryrefslogtreecommitdiff
path: root/compat/mingw.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-04-22 20:42:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-04-22 20:42:58 (GMT)
commita41b41ca741c79a5e751e1d15fc0af72f46a6388 (patch)
tree7805410206ccc0f7f8ab6532afeb4866c1e07a38 /compat/mingw.c
parent33feaca6bfec2b80bcb915cfb477dcb3b14c7ef0 (diff)
parent23eafd924a2df8b52d85afc6c448690d885bb784 (diff)
downloadgit-a41b41ca741c79a5e751e1d15fc0af72f46a6388.zip
git-a41b41ca741c79a5e751e1d15fc0af72f46a6388.tar.gz
git-a41b41ca741c79a5e751e1d15fc0af72f46a6388.tar.bz2
Merge branch 'js/mingw-isilon-nfs'
* js/mingw-isilon-nfs: mingw: cope with the Isilon network file system
Diffstat (limited to 'compat/mingw.c')
-rw-r--r--compat/mingw.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 178a70d..8ee0b64 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -460,8 +460,21 @@ static int mingw_open_append(wchar_t const *wfilename, int oflags, ...)
handle = CreateFileW(wfilename, FILE_APPEND_DATA,
FILE_SHARE_WRITE | FILE_SHARE_READ,
NULL, create, FILE_ATTRIBUTE_NORMAL, NULL);
- if (handle == INVALID_HANDLE_VALUE)
- return errno = err_win_to_posix(GetLastError()), -1;
+ if (handle == INVALID_HANDLE_VALUE) {
+ DWORD err = GetLastError();
+
+ /*
+ * Some network storage solutions (e.g. Isilon) might return
+ * ERROR_INVALID_PARAMETER instead of expected error
+ * ERROR_PATH_NOT_FOUND, which results in an unknown error. If
+ * so, let's turn the error to ERROR_PATH_NOT_FOUND instead.
+ */
+ if (err == ERROR_INVALID_PARAMETER)
+ err = ERROR_PATH_NOT_FOUND;
+
+ errno = err_win_to_posix(err);
+ return -1;
+ }
/*
* No O_APPEND here, because the CRT uses it only to reset the