Re: AIX 4.3 getaddrinfo busted

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Chernow <ac(at)esilo(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: AIX 4.3 getaddrinfo busted
Date: 2009-01-23 16:52:23
Message-ID: 6942.1232729543@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Chernow <ac(at)esilo(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-01-23 17:09:23 Re: Controlling hot standby
Previous Message Kevin Grittner 2009-01-23 16:35:03 Re: Controlling hot standby