projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e578c17
)
Minor cleanup for win32stat.c.
author
Tom Lane
Mon, 12 Oct 2020 15:13:02 +0000
(11:13 -0400)
committer
Tom Lane
Mon, 12 Oct 2020 15:13:02 +0000
(11:13 -0400)
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
src/port/win32stat.c
patch
|
blob
|
blame
|
history
diff --git
a/src/port/win32stat.c
b/src/port/win32stat.c
index d4315c44f4d8b900dbc6cf80f2800ebdaecb0210..9051c713e7bd86ea2f73660092c18f5531e531ad 100644
(file)
--- a/
src/port/win32stat.c
+++ b/
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;
}