aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/port/win32/error.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/backend/port/win32/error.c b/src/backend/port/win32/error.c
index 426eecbf69b..c7f0a24f102 100644
--- a/src/backend/port/win32/error.c
+++ b/src/backend/port/win32/error.c
@@ -6,14 +6,14 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/port/win32/error.c,v 1.4 2004/12/31 22:00:37 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/port/win32/error.c,v 1.5 2005/10/07 16:34:48 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
-static struct
+static const struct
{
DWORD winerr;
int doserr;
@@ -75,6 +75,9 @@ static struct
ERROR_LOCK_VIOLATION, EACCES
},
{
+ ERROR_SHARING_VIOLATION, EACCES
+ },
+ {
ERROR_BAD_NETPATH, ENOENT
},
{
@@ -168,21 +171,21 @@ _dosmaperr(unsigned long e)
return;
}
- for (i = 0; i < sizeof(doserrors) / sizeof(doserrors[0]); i++)
+ for (i = 0; i < lengthof(doserrors); i++)
{
if (doserrors[i].winerr == e)
{
errno = doserrors[i].doserr;
ereport(DEBUG5,
- (errmsg_internal("Mapped win32 error code %i to %i",
- (int) e, errno)));
+ (errmsg_internal("mapped win32 error code %lu to %d",
+ e, errno)));
return;
}
}
- ereport(DEBUG4,
- (errmsg_internal("Unknown win32 error code: %i",
- (int) e)));
+ ereport(LOG,
+ (errmsg_internal("unrecognized win32 error code: %lu",
+ e)));
errno = EINVAL;
return;
}