Re: win32 socket definition

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: James Mansion <james(at)mansionfamily(dot)plus(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: win32 socket definition
Date: 2010-01-10 14:31:59
Message-ID: 9837222c1001100631u2d80ec18hd2d2bb01a2e2e151@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jan 10, 2010 at 13:44, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> On Sun, Jan 10, 2010 at 13:33, James Mansion
> <james(at)mansionfamily(dot)plus(dot)com> wrote:
>> Tom Lane wrote:
>>>
>>> There's another copy of ListenSocket[] in the BackendParameters struct.
>>> I also wonder about postmaster.c's habit of using -1 for empty slots
>>> in ListenSocket ... how safe is that for Win64?
>>>
>>
>> On Windows, it should be INVALID_SOCKET.
>
> Indeed it should, but I think we're Ok anyway. Here's the extract from
> the SDK headers.
>
> /*
>  * This is used instead of -1, since the
>  * SOCKET type is unsigned.
>  */
> #define INVALID_SOCKET  (SOCKET)(~0)
> #define SOCKET_ERROR            (-1)
>
>
> But it might be worthwhile going across all those places and setting
> them to PGINVALID_SOCKET, and typedef that as well.

That was pretty easy, provided I didn't miss too many places :-) So I
did that, and applied.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2010-01-10 15:49:00 Re: Small Bug in GetConflictingVirtualXIDs
Previous Message Magnus Hagander 2010-01-10 13:25:06 RADIUS authentication