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:
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user