1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Fix residual breakage from Windows socket-errno patch: the routines

that should use regular errno, not WSAGetLastError(), now do so again.
This commit is contained in:
Tom Lane
2001-08-03 22:11:39 +00:00
parent 886d7dec79
commit 2b769c8212
4 changed files with 32 additions and 38 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.104 2001/07/20 17:45:06 momjian Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.105 2001/08/03 22:11:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -2037,6 +2037,10 @@ 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
@ -2051,11 +2055,7 @@ PQoidValue(const PGresult *res)
if (!res || !res->cmdStatus || strncmp(res->cmdStatus, "INSERT ", 7) != 0)
return InvalidOid;
#ifdef WIN32
WSASetLastError(0);
#else
errno = 0;
#endif
result = strtoul(res->cmdStatus + 7, &endptr, 10);
if (!endptr || (*endptr != ' ' && *endptr != '\0') || errno == ERANGE)
@ -2064,6 +2064,10 @@ PQoidValue(const PGresult *res)
return (Oid) result;
}
#ifdef WIN32 /* back to socket errno */
#define errno WSAGetLastError()
#endif
/*
PQcmdTuples -
if the last command was an INSERT/UPDATE/DELETE, return number