Re: Diff for src/interfaces/libpq/fe-connect.c between version 1.195 - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Diff for src/interfaces/libpq/fe-connect.c between version 1.195
Date
Msg-id 200210110348.g9B3ms212691@candle.pha.pa.us
Whole thread Raw
Responses Re: Diff for src/interfaces/libpq/fe-connect.c between version  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Denis A Ustimenko wrote:
> Hello Bruce!
> 
> You have patched fe-connect.c and dropeed out one check in line 1078:
> 
> < while (rp == NULL || remains.tv_sec > 0 || (remains.tv_sec == 0 && remains.tv_usec > 0))
> ---
> > while (rp == NULL || remains.tv_sec > 0 || remains.tv_usec > 0)
> 
> As I understand it is dangerous. The remains.tv_usec can be greater than zero while remains.tv_sec is below zero. It
mustexit form the loop in that conditions.
 

[ CC to hackers.]

Well, I can see how it could go negative, but if that happens, we have a
bigger problem.  tv_sec on my system is an unsigned int, so I think the
value will show as huge rather than negative.  If you want negative
values, I think you are going to need to use a real signed integer. 
Would you send a context diff (diff -c) against CVS with a fix?

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Open items
Next
From: Bruce Momjian
Date:
Subject: Re: Diff for src/interfaces/libpq/fe-connect.c between version