aboutsummaryrefslogtreecommitdiff
path: root/src/backend/postmaster/postmaster.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2014-04-16 10:45:48 -0400
committerBruce Momjian <bruce@momjian.us>2014-04-16 10:45:48 -0400
commit966f015b60d90f6450cbadcbfa89e21408fe52f9 (patch)
tree2b1bcc74ac9cfbef514fb19cea89b3cf95a899d7 /src/backend/postmaster/postmaster.c
parenta4c4e0bf60f0f8dbe2556fabd94eb827ae376032 (diff)
downloadpostgresql-966f015b60d90f6450cbadcbfa89e21408fe52f9.tar.gz
postgresql-966f015b60d90f6450cbadcbfa89e21408fe52f9.zip
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.
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r--src/backend/postmaster/postmaster.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 0b748ccfbe1..b0e67b554f0 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -1919,7 +1919,7 @@ ConnCreate(int serverFd)
if (StreamConnection(serverFd, port) != STATUS_OK)
{
- if (port->sock >= 0)
+ if (port->sock != PGINVALID_SOCKET)
StreamClose(port->sock);
ConnFree(port);
return NULL;