Re: win32 socket definition

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: win32 socket definition
Дата
Msg-id 9837222c1001100444x733e842aqc2c1cb5f48e35b8c@mail.gmail.com
обсуждение исходный текст
Ответ на Re: win32 socket definition  (James Mansion <james@mansionfamily.plus.com>)
Ответы Re: win32 socket definition  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-hackers
On Sun, Jan 10, 2010 at 13:33, James Mansion
<james@mansionfamily.plus.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.

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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: James Mansion
Дата:
Сообщение: Re: win32 socket definition
Следующее
От: Robert Haas
Дата:
Сообщение: Re: damage control mode