Re: [BUG FIX] Compare returned value by socket() against PGINVALID_SOCKET instead of < 0

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Joel Jacobson <joel(at)trustly(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUG FIX] Compare returned value by socket() against PGINVALID_SOCKET instead of < 0
Date: 2014-04-16 14:46:49
Message-ID: 20140416144649.GB7443@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 11, 2014 at 08:28:55AM -0400, Bruce Momjian wrote:
> On Fri, Apr 11, 2014 at 10:03:08AM +0530, Amit Kapila wrote:
> > On Fri, Apr 11, 2014 at 10:00 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> > > On Thu, Apr 10, 2014 at 5:21 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > >> On Thu, Apr 10, 2014 at 11:05:49AM +0530, Amit Kapila wrote:
> > >
> > >> Ah, yes, good point. This is going to require backpatching then.
> > >
> > > I also think so.
> > >
> > >>> I think it's better to use check like below, just for matter of
> > >>> consistency with other place
> > >>> if (sock == INVALID_SOCKET)
> > >>
> > >> Agreed. That is how I have coded the patch.
> > >
> > > Sorry, I didn't checked the latest patch before that comment.
> > >
> > > I verified that your last patch is fine. Regression test also went fine.
> >
> > I have noticed small thing which I forgot to mention in previous mail.
> > I think below added extra line is not required.
> >
> > int
> > PQsocket(const PGconn *conn)
> > {
> > +
>
> Yes, I saw that yesterday and fixed it. I also did a dry run of
> backpatching and only 8.4 had conflicts, so I think we are good there.
> (This is like the readdir() fix all over again.)

Patch applied back through 9.0. 8.4 didn't have the infrastructure for
a proper fix.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-04-16 14:49:55 Re: Clock sweep not caching enough B-Tree leaf pages?
Previous Message Robert Haas 2014-04-16 14:43:41 Re: Archive recovery won't be completed on some situation.