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

From: Joel Jacobson <joel(at)trustly(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: [BUG FIX] Compare returned value by socket() against PGINVALID_SOCKET instead of < 0
Date: 2013-12-25 12:35:15
Message-ID: CAASwCXe2rQX66Wzw10KMEhGB1C+hZWFEAvvm-VpRik6PpFAUZA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Joel Jacobson

Attachment Content-Type Size
use-PGINVALID_SOCKET.patch application/octet-stream 3.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2013-12-25 12:38:36 [BUG FIX] Version number expressed in octal form by mistake
Previous Message Andreas Joseph Krogh 2013-12-25 12:01:03 BDR-project