Skip to content
Permalink
Browse files

Merge pull request #2253 from naatje80/isilon_storage_error

Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
  • Loading branch information...
dscho committed Jul 8, 2019
2 parents e213867 + e577125 commit fcf334eb78f1901eca8b227966486e0fceac56d0
Showing with 13 additions and 2 deletions.
  1. +13 −2 compat/mingw.c
@@ -661,8 +661,19 @@ 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 a unknow error. If
* so, the error is now forced to be an ERROR_PATH_NOT_FOUND
* error instead.
*/
if (err == ERROR_INVALID_PARAMETER)
err = ERROR_PATH_NOT_FOUND;
return errno = err_win_to_posix(err), -1;
}

/*
* No O_APPEND here, because the CRT uses it only to reset the

0 comments on commit fcf334e

Please sign in to comment.
You can’t perform that action at this time.