summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2005-08-13 01:34:30 +0000
committerBruce Momjian2005-08-13 01:34:30 +0000
commitf810cfb291e4cb0e0e1bbe1b6e6158dc5367a2c8 (patch)
tree853fe82d335d987d12842ba1635ef7041d993820
parent27639809d2f05d84482e315e1107cc7f93a00e22 (diff)
Disable strtoul() ERANGE check on Win32, because it isn't thread safe,
and it isn't really required.
-rw-r--r--src/interfaces/libpq/fe-exec.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index 64b4638b69..2f3bd87317 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.170 2005/07/02 17:01:54 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.171 2005/08/13 01:34:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2166,7 +2166,15 @@ PQoidValue(const PGresult *res)
#endif
result = strtoul(res->cmdStatus + 7, &endptr, 10);
- if (!endptr || (*endptr != ' ' && *endptr != '\0') || errno == ERANGE)
+ if (!endptr || (*endptr != ' ' && *endptr != '\0')
+#ifndef WIN32
+ /*
+ * On WIN32, errno is not thread-safe and GetLastError() isn't set by
+ * strtoul(), so we can't check on this platform.
+ */
+ || errno == ERANGE
+#endif
+ )
return InvalidOid;
else
return (Oid) result;