From: Tom Lane Date: Sat, 17 Feb 2001 03:37:22 +0000 (+0000) Subject: Seems a bad idea to assume that select(2) doesn't touch the input masks X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=81051f1bc11930644f5f524ce34a09b04ac41bc9;p=users%2Fbernd%2Fpostgres.git Seems a bad idea to assume that select(2) doesn't touch the input masks if it returns EINTR. --- diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 9e116f1c68..f1cd0242c4 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -320,11 +320,11 @@ pqReadReady(PGconn *conn) if (!conn || conn->sock < 0) return -1; +retry: FD_ZERO(&input_mask); FD_SET(conn->sock, &input_mask); timeout.tv_sec = 0; timeout.tv_usec = 0; -retry: if (select(conn->sock + 1, &input_mask, (fd_set *) NULL, (fd_set *) NULL, &timeout) < 0) { @@ -354,11 +354,11 @@ pqWriteReady(PGconn *conn) if (!conn || conn->sock < 0) return -1; +retry: FD_ZERO(&input_mask); FD_SET(conn->sock, &input_mask); timeout.tv_sec = 0; timeout.tv_usec = 0; -retry: if (select(conn->sock + 1, (fd_set *) NULL, &input_mask, (fd_set *) NULL, &timeout) < 0) {