Seems a bad idea to assume that select(2) doesn't touch the input masks
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 17 Feb 2001 03:37:22 +0000 (03:37 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 17 Feb 2001 03:37:22 +0000 (03:37 +0000)
if it returns EINTR.

src/interfaces/libpq/fe-misc.c

index 9e116f1c683ec7eeb26ed16b1053b2b503ca49cb..f1cd0242c4eba72cb77d75efd11213a733cecef1 100644 (file)
@@ -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)
        {