1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

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
This commit is contained in:
Tom Lane
2020-10-12 11:13:02 -04:00
parent e578c17d81
commit fcd11329db

View File

@ -204,8 +204,10 @@ _pgstat64(const char *name, struct stat *buf)
NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
DWORD err = GetLastError();
CloseHandle(hFile);
errno = ENOENT;
_dosmaperr(err);
return -1;
}