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

Commitb888ab8

Browse files
committed
Recognize ERROR_SHARING_VIOLATION (translate to EACCES), increase log
level for unrecognized win32 error codes to LOG, and make messagesconform to style guide. Per old suggestion from Qingqing Zhou, whichseems to have gotten lost in the shuffle.
1 parentd156e1f commitb888ab8

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

‎src/backend/port/win32/error.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $PostgreSQL: pgsql/src/backend/port/win32/error.c,v 1.4 2004/12/31 22:00:37 pgsql Exp $
9+
* $PostgreSQL: pgsql/src/backend/port/win32/error.c,v 1.5 2005/10/07 16:34:48 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
1313

1414
#include"postgres.h"
1515

16-
staticstruct
16+
staticconststruct
1717
{
1818
DWORDwinerr;
1919
intdoserr;
@@ -74,6 +74,9 @@ static struct
7474
{
7575
ERROR_LOCK_VIOLATION,EACCES
7676
},
77+
{
78+
ERROR_SHARING_VIOLATION,EACCES
79+
},
7780
{
7881
ERROR_BAD_NETPATH,ENOENT
7982
},
@@ -168,21 +171,21 @@ _dosmaperr(unsigned long e)
168171
return;
169172
}
170173

171-
for (i=0;i<sizeof(doserrors) /sizeof(doserrors[0]);i++)
174+
for (i=0;i<lengthof(doserrors);i++)
172175
{
173176
if (doserrors[i].winerr==e)
174177
{
175178
errno=doserrors[i].doserr;
176179
ereport(DEBUG5,
177-
(errmsg_internal("Mapped win32 error code %i to %i",
178-
(int)e,errno)));
180+
(errmsg_internal("mapped win32 error code %lu to %d",
181+
e,errno)));
179182
return;
180183
}
181184
}
182185

183-
ereport(DEBUG4,
184-
(errmsg_internal("Unknown win32 error code: %i",
185-
(int)e)));
186+
ereport(LOG,
187+
(errmsg_internal("unrecognized win32 error code: %lu",
188+
e)));
186189
errno=EINVAL;
187190
return;
188191
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp