Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf836c2e

Browse files
committed
Add some debug logging code to AllocateFile's failure path to log the
specific Windows error code (GetLastError). This is a hopefully temporaryhack to try to diagnose rare failures. Magnus Hagander
1 parent6935652 commitf836c2e

File tree

1 file changed

+15
-1
lines changed
  • src/backend/storage/file

1 file changed

+15
-1
lines changed

‎src/backend/storage/file/fd.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/storage/file/fd.c,v 1.128 2006/05/30 13:04:59 momjian Exp $
10+
* $PostgreSQL: pgsql/src/backend/storage/file/fd.c,v 1.129 2006/08/24 03:15:43 tgl Exp $
1111
*
1212
* NOTES:
1313
*
@@ -1278,6 +1278,20 @@ AllocateFile(const char *name, const char *mode)
12781278
errno=save_errno;
12791279
}
12801280

1281+
/*
1282+
* TEMPORARY hack to log the Windows error code on fopen failures,
1283+
* in hopes of diagnosing some hard-to-reproduce problems.
1284+
*/
1285+
#ifdefWIN32
1286+
{
1287+
intsave_errno=errno;
1288+
1289+
elog(LOG,"Windows fopen(\"%s\",\"%s\") failed: code %lu, errno %d",
1290+
name,mode,GetLastError(),save_errno);
1291+
errno=save_errno;
1292+
}
1293+
#endif
1294+
12811295
returnNULL;
12821296
}
12831297

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp