From: Jens Axboe Date: Wed, 12 Sep 2018 14:50:16 +0000 (-0600) Subject: windows: make win_to_posix_error() more resilient X-Git-Tag: fio-3.11~45 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=bae743b1ed1fb245ace451f81baa0949def35814;p=fio.git windows: make win_to_posix_error() more resilient If we pass in ERROR_SUCCESS, we should get a zero back. Signed-off-by: Jens Axboe --- diff --git a/os/windows/posix.c b/os/windows/posix.c index 5b72beab..fd1d5582 100644 --- a/os/windows/posix.c +++ b/os/windows/posix.c @@ -35,6 +35,8 @@ HRESULT WINAPI StringCchPrintfA(char *pszDest, size_t cchDest, const char *pszFo int win_to_posix_error(DWORD winerr) { switch (winerr) { + case ERROR_SUCCESS: + return 0; case ERROR_FILE_NOT_FOUND: return ENOENT; case ERROR_PATH_NOT_FOUND: