Tom Lane wrote:
BTW, what about the comments in ip.c to the effect that some versions of
AIX fail when getaddrinfo's second argument *is* null?


For starters, it indicates that sin_port is not zero'd properly. That wouldn't matter here since the plan is to manually set the port in this case, since providing it to getaddrinfo is broken.

Also, this is why I suggested only doing a NULL 2nd arg within the failure case.

rc = getaddrinfo(hostname, service, ....);

#ifdef _AIX
if(rc == EAI_NODATA && servname && *servname)
  if(!(rc = getaddrinfo(hostname, NULL, ....))) /* try again */
    /* set sin_port or sin6_port */
#endif

// code continues as is from here down.

Or, set a define in configure indicating aix 4.3 or indicating the 2nd arg to getaddrinfo must be NULL (the former being much easier). I don't think we have to resort to configure checks though.

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to