Skip to content

Commit 6d9d97e

Browse files
committed
Restore ptmp_timeout for cases where no timeout is passed.
1 parent 9eada51 commit 6d9d97e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/interfaces/libpq/fe-misc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*
2626
*
2727
* IDENTIFICATION
28-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.81 2002/10/14 17:15:11 momjian Exp $
28+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.82 2002/10/14 17:33:08 momjian Exp $
2929
*
3030
*-------------------------------------------------------------------------
3131
*/
@@ -790,6 +790,7 @@ pqWaitTimed(int forRead, int forWrite, PGconn *conn, const struct timeval *timeo
790790
fd_set except_mask;
791791

792792
struct timeval tmp_timeout;
793+
struct timeval *ptmp_timeout = NULL;
793794

794795
if (conn->sock < 0)
795796
{
@@ -826,9 +827,10 @@ pqWaitTimed(int forRead, int forWrite, PGconn *conn, const struct timeval *timeo
826827
* use copy
827828
*/
828829
tmp_timeout = *timeout;
830+
ptmp_timeout = &tmp_timeout;
829831
}
830832
if (select(conn->sock + 1, &input_mask, &output_mask,
831-
&except_mask, &tmp_timeout) < 0)
833+
&except_mask, ptmp_timeout) < 0)
832834
{
833835
if (SOCK_ERRNO == EINTR)
834836
goto retry5;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy