1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

Prevent tv_sec from becoming negative in connection timeout code.

This commit is contained in:
Bruce Momjian
2002-10-11 04:12:14 +00:00
parent c2311337f0
commit 6a7bb0afbc
6 changed files with 68 additions and 27 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.206 2002/10/03 17:09:42 momjian Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.207 2002/10/11 04:12:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1131,7 +1131,10 @@ connectDBComplete(PGconn *conn)
return 0;
}
remains.tv_sec = finish_time - current_time;
if (finish_time > current_time)
remains.tv_sec = finish_time - current_time;
else
remains.tv_sec = 0;
remains.tv_usec = 0;
}
}