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-protocol2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/interfaces/libpq/fe-protocol2.c') diff --git a/src/interfaces/libpq/fe-protocol2.c b/src/interfaces/libpq/fe-protocol2.c index f3fddaa036..10510b5bf5 100644 --- a/src/interfaces/libpq/fe-protocol2.c +++ b/src/interfaces/libpq/fe-protocol2.c @@ -1211,7 +1211,7 @@ pqGetline2(PGconn *conn, char *s, int maxlen) { int result = 1; /* return value if buffer overflows */ - if (conn->sock < 0 || + if (conn->sock == PGINVALID_SOCKET || conn->asyncStatus != PGASYNC_COPY_OUT) { *s = '\0'; -- cgit v1.2.1