*** postgresql-7.0.3/src/interfaces/libpq/fe-connect.c.orig Mon May 28 12:54:25 2001 --- postgresql-7.0.3/src/interfaces/libpq/fe-connect.c Mon May 28 12:55:09 2001 *************** *** 1830,1836 **** static void closePGconn(PGconn *conn) { ! if (conn->sock >= 0) { /* --- 1830,1836 ---- static void closePGconn(PGconn *conn) { ! if (conn->status != CONNECTION_BAD && conn->sock >= 0) { /* *** postgresql-7.0.3/src/interfaces/libpq/fe-misc.c.orig Mon May 28 12:54:33 2001 --- postgresql-7.0.3/src/interfaces/libpq/fe-misc.c Mon May 28 12:58:46 2001 *************** *** 320,331 **** if (!conn || conn->sock < 0) return -1; ! 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) { --- 320,331 ---- 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; ! if (select(conn->sock + 1, &input_mask, (fd_set *) NULL, (fd_set *) NULL, &timeout) < 0) { *************** *** 354,365 **** if (!conn || conn->sock < 0) return -1; ! 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) { --- 354,365 ---- 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; ! if (select(conn->sock + 1, (fd_set *) NULL, &input_mask, (fd_set *) NULL, &timeout) < 0) { *************** *** 719,724 **** --- 719,725 ---- { fd_set input_mask; fd_set output_mask; + fd_set except_mask; if (conn->sock < 0) { *************** *** 732,742 **** retry: FD_ZERO(&input_mask); FD_ZERO(&output_mask); if (forRead) FD_SET(conn->sock, &input_mask); if (forWrite) FD_SET(conn->sock, &output_mask); ! if (select(conn->sock + 1, &input_mask, &output_mask, (fd_set *) NULL, (struct timeval *) NULL) < 0) { if (errno == EINTR) --- 733,745 ---- retry: FD_ZERO(&input_mask); FD_ZERO(&output_mask); + FD_ZERO(&except_mask); if (forRead) FD_SET(conn->sock, &input_mask); if (forWrite) FD_SET(conn->sock, &output_mask); ! FD_SET(conn->sock, &except_mask); ! if (select(conn->sock + 1, &input_mask, &output_mask, &except_mask, (struct timeval *) NULL) < 0) { if (errno == EINTR)