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

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Denis A Ustimenko <denis(at)oldham(dot)ru>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Diff for src/interfaces/libpq/fe-connect.c between version 1.195
Date: 2002-10-11 03:48:54
Message-ID: 200210110348.g9B3ms212691@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 must exit 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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-10-11 04:10:42 Re: Diff for src/interfaces/libpq/fe-connect.c between version
Previous Message Barry Lind 2002-10-11 00:57:55 [Fwd: Re: [JDBC] Patch for handling "autocommit=false" in postgresql.conf]