diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2003-09-09 18:37:12 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2003-09-09 18:37:12 +0000 |
commit | 3e29ed7a564da48e5d00df5bd2608ea42650b85a (patch) | |
tree | 02e7fc183515755906917f90c8bb35dd41beedfe | |
parent | fba13c1ab53280341e53efc92058c40f6e76e1fb (diff) | |
download | libapr-3e29ed7a564da48e5d00df5bd2608ea42650b85a.tar.gz |
work around a problem in current AIX getaddrinfo()
it wasn't needed in previous releases of APR or Apache because
we didn't call the resolver when hostname was NULL
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64613 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | network_io/unix/sockaddr.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 765252b2e..9f9bb85ed 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -391,6 +391,16 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, /* getaddrinfo according to RFC 2553 must have either hostname * or servname non-NULL. */ +#ifdef _AIX + /* But current AIX getaddrinfo() doesn't like servname = "0"; + * the "1" won't hurt since we use the port parameter to fill + * in the returned socket addresses later + */ + if (!port) { + servname = "1"; + } + else +#endif servname = apr_itoa(p, port); } error = getaddrinfo(hostname, servname, &hints, &ai_list); |