Commit fcd11329 authored by Tom Lane's avatar Tom Lane

Minor cleanup for win32stat.c.

Use GetLastError(), rather than assuming that CreateFile() failure
must map to ENOENT.  Noted by Michael Paquier.

Discussion: https://postgr.es/m/CAC+AXB0g44SbvSpC86o_1HWh8TAU2pZrMRW6tJT-dkijotx5Qg@mail.gmail.com
parent e578c17d
...@@ -204,8 +204,10 @@ _pgstat64(const char *name, struct stat *buf) ...@@ -204,8 +204,10 @@ _pgstat64(const char *name, struct stat *buf)
NULL); NULL);
if (hFile == INVALID_HANDLE_VALUE) if (hFile == INVALID_HANDLE_VALUE)
{ {
DWORD err = GetLastError();
CloseHandle(hFile); CloseHandle(hFile);
errno = ENOENT; _dosmaperr(err);
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment