Re: AIX 4.3 getaddrinfo busted - Mailing list pgsql-hackers

From Tom Lane
Subject Re: AIX 4.3 getaddrinfo busted
Date
Msg-id 6942.1232729543@sss.pgh.pa.us
Whole thread Raw
In response to Re: AIX 4.3 getaddrinfo busted  (Andrew Chernow <ac@esilo.com>)
Responses Re: AIX 4.3 getaddrinfo busted  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Controlling hot standby
Next
From: Robert Haas
Date:
Subject: Re: Controlling hot standby