diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2001-05-02 02:54:11 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2001-05-02 02:54:11 +0000 |
commit | f738a7ccce9af790f75582b77b903b73daf3c9dc (patch) | |
tree | e16635d21ca0fd015e7109634bb7ef63b448714e /network_io | |
parent | d2917f30b2f43e4447ce3782d66f57826a72a195 (diff) | |
download | libapr-f738a7ccce9af790f75582b77b903b73daf3c9dc.tar.gz |
Fix a problem on unixware where clearing h_errno wouldn't work.
Use set_h_errno() instead.
PR: 7651
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61581 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io')
-rw-r--r-- | network_io/unix/sa_common.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index a4c5c940e..5e1a7e329 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -71,6 +71,12 @@ #include <stdlib.h> #endif +#ifdef HAVE_SET_H_ERRNO +#define SET_H_ERRNO(newval) set_h_errno(newval) +#else +#define SET_H_ERRNO(newval) h_errno = (newval) +#endif + APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, apr_port_t port) { @@ -441,7 +447,9 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, char tmphostname[256]; #endif - h_errno = 0; /* don't know if it is portable for getnameinfo() to set h_errno */ + /* don't know if it is portable for getnameinfo() to set h_errno; + * clear it then see if it was set */ + SET_H_ERRNO(0); /* default flags are NI_NAMREQD; otherwise, getnameinfo() will return * a numeric address string if it fails to resolve the host name; * that is *not* what we want here |