1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-25 13:17:41 +03:00

i've spotted a following problem using DBD::Pg under win32. winsock

functions do not set errno, so some normal conditions are treated as
fatal errors. e.g. fetching large tuples fails, as at some point recv()
returns EWOULDBLOCK. here's a patch, which replaces errno with
WSAGetLastError(). i've tried to to affect non-win32 code.

Dmitry Yurtaev
This commit is contained in:
Bruce Momjian
2001-07-20 17:45:06 +00:00
parent 8f75c1b0c7
commit 8c79f3c4a3
4 changed files with 36 additions and 18 deletions

View File

@@ -21,3 +21,18 @@
* crypt not available (yet)
*/
#define crypt(a,b) a
/*
* assumes that errno is used for sockets only
*
*/
#undef errno
#undef EINTR
#undef EAGAIN /* doesn't apply on sockets */
#define errno WSAGetLastError()
#define EINTR WSAEINTR
#define EWOULDBLOCK WSAEWOULDBLOCK
#define ECONNRESET WSAECONNRESET
#define EINPROGRESS WSAEINPROGRESS