|
6 | 6 | * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
7 | 7 | *
|
8 | 8 | * 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 $ |
10 | 10 | *
|
11 | 11 | *-------------------------------------------------------------------------
|
12 | 12 | */
|
13 | 13 |
|
14 | 14 | #include"postgres.h"
|
15 | 15 |
|
16 |
| -staticstruct |
| 16 | +staticconststruct |
17 | 17 | {
|
18 | 18 | DWORDwinerr;
|
19 | 19 | intdoserr;
|
@@ -74,6 +74,9 @@ static struct
|
74 | 74 | {
|
75 | 75 | ERROR_LOCK_VIOLATION,EACCES
|
76 | 76 | },
|
| 77 | +{ |
| 78 | +ERROR_SHARING_VIOLATION,EACCES |
| 79 | +}, |
77 | 80 | {
|
78 | 81 | ERROR_BAD_NETPATH,ENOENT
|
79 | 82 | },
|
@@ -168,21 +171,21 @@ _dosmaperr(unsigned long e)
|
168 | 171 | return;
|
169 | 172 | }
|
170 | 173 |
|
171 |
| -for (i=0;i<sizeof(doserrors) /sizeof(doserrors[0]);i++) |
| 174 | +for (i=0;i<lengthof(doserrors);i++) |
172 | 175 | {
|
173 | 176 | if (doserrors[i].winerr==e)
|
174 | 177 | {
|
175 | 178 | errno=doserrors[i].doserr;
|
176 | 179 | 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))); |
179 | 182 | return;
|
180 | 183 | }
|
181 | 184 | }
|
182 | 185 |
|
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))); |
186 | 189 | errno=EINVAL;
|
187 | 190 | return;
|
188 | 191 | }
|