1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00

check socket creation errors against PGINVALID_SOCKET

Previously, in some places, socket creation errors were checked for
negative values, which is not true for Windows because sockets are
unsigned.  This masked socket creation errors on Windows.

Backpatch through 9.0.  8.4 doesn't have the infrastructure to fix this.
This commit is contained in:
Bruce Momjian
2014-04-16 10:45:48 -04:00
parent a4c4e0bf60
commit 966f015b60
7 changed files with 42 additions and 17 deletions

View File

@ -132,7 +132,7 @@ int
pgwin32_waitforsinglesocket(SOCKET s, int what, int timeout)
{
static HANDLE waitevent = INVALID_HANDLE_VALUE;
static SOCKET current_socket = -1;
static SOCKET current_socket = INVALID_SOCKET;
static int isUDP = 0;
HANDLE events[2];
int r;