summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/port/win32stat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/port/win32stat.c b/src/port/win32stat.c
index d4315c44f4d..9051c713e7b 100644
--- 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;
}