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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user