diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 114f23f7974f25348b4747d031f3a88df20e8a9a..6f9ba4abddf65daf4f75d215ac36760ce36c8250 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.207 2002/10/11 04:12:14 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.208 2002/10/11 04:41:59 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1078,7 +1078,8 @@ connectDBComplete(PGconn *conn) finish_time = time((time_t *) NULL) + remains.tv_sec; } - while (rp == NULL || remains.tv_sec > 0 || remains.tv_usec > 0) + while (rp == NULL || remains.tv_sec > 0 || + (remains.tv_sec == 0 && remains.tv_usec > 0)) { /* * Wait, if necessary. Note that the initial state (just after @@ -1131,10 +1132,7 @@ connectDBComplete(PGconn *conn) return 0; } - if (finish_time > current_time) - remains.tv_sec = finish_time - current_time; - else - remains.tv_sec = 0; + remains.tv_sec = finish_time - current_time; remains.tv_usec = 0; } }