summaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-exec.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2001-08-21 20:39:54 +0000
committerBruce Momjian <bruce@momjian.us>2001-08-21 20:39:54 +0000
commit5db5c2db61e7b6493c3a92742bf5ee1e49e3e511 (patch)
tree8c5a7c63a35bd3dcded2edbae31a6c910beb7c1d /src/interfaces/libpq/fe-exec.c
parentf933766ba7c5446a28d714904ae0c46d8b21b86a (diff)
> Ok, where's a "system dependent hack" :)
> It seems that win9x doesn't have the "netmsg.dll" so it defaults to "normal" > FormatMessage. > I wonder if one could load wsock32.dll or winsock.dll on those systems > instead of netmsg.dll. > > Mikhail, could you please test this code on your nt4 system? > Could someone else test this code on a win98/95 system? > > It works on win2k over here. It works on win2k here too but not on win98/95 or winNT. Anyway, attached is the patch which uses Magnus's my_sock_strerror function (renamed to winsock_strerror). The only difference is that I put the code to load and unload netmsg.dll in the libpqdll.c (is this OK Magnus?). Mikhail Terekhov
Diffstat (limited to 'src/interfaces/libpq/fe-exec.c')
-rw-r--r--src/interfaces/libpq/fe-exec.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index 8fd0a5c8b64..d02b74490e7 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.107 2001/08/17 15:11:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.108 2001/08/21 20:39:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2038,10 +2038,6 @@ PQoidStatus(const PGresult *res)
return buf;
}
-#ifdef WIN32 /* need to get at normal errno here */
-#undef errno
-#endif
-
/*
PQoidValue -
a perhaps preferable form of the above which just returns
@@ -2056,7 +2052,11 @@ PQoidValue(const PGresult *res)
if (!res || !res->cmdStatus || strncmp(res->cmdStatus, "INSERT ", 7) != 0)
return InvalidOid;
+#ifdef WIN32
+ SetLastError(0);
+#else
errno = 0;
+#endif
result = strtoul(res->cmdStatus + 7, &endptr, 10);
if (!endptr || (*endptr != ' ' && *endptr != '\0') || errno == ERANGE)
@@ -2065,9 +2065,6 @@ PQoidValue(const PGresult *res)
return (Oid) result;
}
-#ifdef WIN32 /* back to socket errno */
-#define errno WSAGetLastError()
-#endif
/*
PQcmdTuples -