From 5d305d86bd917723f09ab4f15c075d90586a210a Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 16 Apr 2014 19:46:51 -0400 Subject: libpq: use pgsocket for socket values, for portability Previously, 'int' was used for socket values in libpq, but socket values are unsigned on Windows. This is a style correction. Initial patch and previous PGINVALID_SOCKET initial patch by Joel Jacobson, modified by me Report from PVS-Studio --- src/interfaces/libpq/fe-misc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/interfaces/libpq/fe-misc.c') diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index a7afd42556..cc487b22ee 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -604,7 +604,7 @@ pqReadData(PGconn *conn) int someread = 0; int nread; - if (conn->sock < 0) + if (conn->sock == PGINVALID_SOCKET) { printfPQExpBuffer(&conn->errorMessage, libpq_gettext("connection not open\n")); @@ -800,7 +800,7 @@ pqSendSome(PGconn *conn, int len) int remaining = conn->outCount; int result = 0; - if (conn->sock < 0) + if (conn->sock == PGINVALID_SOCKET) { printfPQExpBuffer(&conn->errorMessage, libpq_gettext("connection not open\n")); @@ -1011,7 +1011,7 @@ pqSocketCheck(PGconn *conn, int forRead, int forWrite, time_t end_time) if (!conn) return -1; - if (conn->sock < 0) + if (conn->sock == PGINVALID_SOCKET) { printfPQExpBuffer(&conn->errorMessage, libpq_gettext("socket not open\n")); -- cgit v1.2.1