mirror of
https://github.com/postgres/postgres.git
synced 2025-05-06 19:59:18 +03:00
Add some debug logging code to AllocateFile's failure path to log the
specific Windows error code (GetLastError). This is a hopefully temporary hack to try to diagnose rare failures. Magnus Hagander
This commit is contained in:
parent
6935652c34
commit
f836c2e37e
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/storage/file/fd.c,v 1.128 2006/05/30 13:04:59 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/storage/file/fd.c,v 1.129 2006/08/24 03:15:43 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES:
|
* NOTES:
|
||||||
*
|
*
|
||||||
@ -1278,6 +1278,20 @@ TryAgain:
|
|||||||
errno = save_errno;
|
errno = save_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TEMPORARY hack to log the Windows error code on fopen failures,
|
||||||
|
* in hopes of diagnosing some hard-to-reproduce problems.
|
||||||
|
*/
|
||||||
|
#ifdef WIN32
|
||||||
|
{
|
||||||
|
int save_errno = errno;
|
||||||
|
|
||||||
|
elog(LOG, "Windows fopen(\"%s\",\"%s\") failed: code %lu, errno %d",
|
||||||
|
name, mode, GetLastError(), save_errno);
|
||||||
|
errno = save_errno;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user