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:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user