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
pull/57/head
Tom Lane 5 years ago
parent e578c17d81
commit fcd11329db
  1. 4
      src/port/win32stat.c

@ -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…
Cancel
Save