clear on that point.
conn->status = CONNECTION_BAD;
return 0;
}
- remains.tv_usec = 0;
+ remains.tv_usec = 0; /* We don't use subsecond timing */
rp = &remains;
/* calculate the finish time based on start + timeout */
finish_time = time((time_t *) NULL) + remains.tv_sec;
}
- while (rp == NULL || remains.tv_sec > 0 ||
- (remains.tv_sec == 0 && remains.tv_usec > 0))
+ while (rp == NULL || remains.tv_sec > 0)
{
/*
* Wait, if necessary. Note that the initial state (just after
}
remains.tv_sec = finish_time - current_time;
- remains.tv_usec = 0;
}
}
conn->status = CONNECTION_BAD;
}
int
-pqWaitTimed(int forRead, int forWrite, PGconn *conn, const struct timeval * timeout)
+pqWaitTimed(int forRead, int forWrite, PGconn *conn, const struct timeval *timeout)
{
fd_set input_mask;
fd_set output_mask;
fd_set except_mask;
struct timeval tmp_timeout;
- struct timeval *ptmp_timeout = NULL;
if (conn->sock < 0)
{
if (NULL != timeout)
{
/*
- * select may modify timeout argument on some platforms use
- * copy
+ * select() may modify timeout argument on some platforms so
+ * use copy
*/
tmp_timeout = *timeout;
- ptmp_timeout = &tmp_timeout;
}
if (select(conn->sock + 1, &input_mask, &output_mask,
- &except_mask, ptmp_timeout) < 0)
+ &except_mask, &tmp_timeout) < 0)
{
if (SOCK_ERRNO == EINTR)
goto retry5;
extern int pqFlush(PGconn *conn);
extern int pqSendSome(PGconn *conn);
extern int pqWait(int forRead, int forWrite, PGconn *conn);
-extern int pqWaitTimed(int forRead, int forWrite, PGconn *conn, const struct timeval * timeout);
+extern int pqWaitTimed(int forRead, int forWrite, PGconn *conn, const struct timeval *timeout);
extern int pqReadReady(PGconn *conn);
extern int pqWriteReady(PGconn *conn);