*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.36 2006/06/20 19:56:52 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.37 2006/10/19 17:26:32 tgl Exp $
*
* This file and the IPV6 implementation were initially provided by
* Nigel Kukard <nkukard@lbsd.net>, Linux Based Systems Design
return getaddrinfo_unix(servname, hintp, result);
#endif
+#ifdef _AIX
+ /*
+ * It seems AIX's getaddrinfo doesn't reliably zero sin_port when servname
+ * is NULL, so force the issue.
+ */
+ if (servname == NULL)
+ servname = "0";
+#endif
+
/* NULL has special meaning to getaddrinfo(). */
return getaddrinfo((!hostname || hostname[0] == '\0') ? NULL : hostname,
servname, hintp, result);