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

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Joel Jacobson <joel(at)trustly(dot)com>
Cc: 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-01-01 05:12:23
Message-ID: CAA4eK1JjhYAzP6j8Fm49+F4PyYzaQ82w2CTLvbkeQ6WspOLfbA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 25, 2013 at 6:05 PM, Joel Jacobson <joel(at)trustly(dot)com> wrote:
> Hi,
>
> I've tried to fix some bugs reported by Andrey Karpov in an article at
> http://www.viva64.com/en/b/0227/
>
> The value returned by socket() is unsigned on Windows and can thus not
> be checked if less than zero to detect an error, instead
> PGINVALID_SOCKET should be used, which is hard-coded to -1 on
> non-windows platforms.

Though I have not verified all instances you have fixed in your patch, but I
feel the general direction to fix is right.
I think you can upload your patch for next CommitFest.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christian Kruse 2014-01-01 10:00:59 Re: Patch: show relation and tuple infos of a lock to acquire
Previous Message Amit Kapila 2014-01-01 05:04:44 Re: proposal: persistent plpgsql plugin info - field plugin_info for plpgsql_function structure