mirror of
https://github.com/postgres/postgres.git
synced 2026-02-25 02:44:39 -05: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:
parent
e578c17d81
commit
fcd11329db
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue