Re: AIX 4.3 getaddrinfo busted

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: AIX 4.3 getaddrinfo busted
Дата
Msg-id 6942.1232729543@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: AIX 4.3 getaddrinfo busted  (Andrew Chernow <ac@esilo.com>)
Ответы Re: AIX 4.3 getaddrinfo busted  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Andrew Chernow <ac@esilo.com> writes:
> Tom Lane wrote:
>> The portability risk is in the "manually set the port" part.

> Right.  If this method is limited to _AIX and only when the failure case 
> occurs, there are no portability issues.

That seems like unnecessary complexity (which carries its own risks).
I thought this sketch was about right:

#ifdef _AIX
getaddrinfo(hostname, NULL /* servname */, ....);
// manually set the port
#else
getaddrinfo(hostname, servname, ....); /* same code as now */
#endif

although please flip it around to ifndef.  The simpler and more general
case should usually be first to aid the reader.
        regards, tom lane


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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Controlling hot standby
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Controlling hot standby