diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2001-12-07 15:48:06 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2001-12-07 15:48:06 +0000 |
commit | f8328b0a1548b083771c312326cd30a40816092a (patch) | |
tree | 74e6f05170cd081e203dd392b6a42a724c5f4e5c | |
parent | 9b877e78aaeac61c464b1164a356d1b483e70452 (diff) | |
download | libapr-f8328b0a1548b083771c312326cd30a40816092a.tar.gz |
don't try to use getaddrinfo() on systems without gai_strerror()
this fixes a build error on RedHat 5.2
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62608 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | build/apr_network.m4 | 10 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | misc/unix/errorcodes.c | 2 |
4 files changed, 15 insertions, 2 deletions
@@ -1,5 +1,8 @@ Changes with APR b1 + *) Fix build breakage on systems with getaddrinfo() but not + gai_strerror() (e.g., RedHat 5.2). [Jeff Trawick] + *) Fix a problem in Unix apr_file_dup() which caused 0 to be returned by the first read. [Stas Bekman <stas@stason.org>] diff --git a/build/apr_network.m4 b/build/apr_network.m4 index ecaa405a5..4645abd4f 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -5,6 +5,10 @@ dnl dnl dnl check for working getaddrinfo() dnl +dnl Note that if the system doesn't have gai_strerror(), we +dnl can't use getaddrinfo() because we can't get strings +dnl describing the error codes. +dnl AC_DEFUN(APR_CHECK_WORKING_GETADDRINFO,[ AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[ AC_TRY_RUN( [ @@ -44,7 +48,11 @@ void main(void) { ac_cv_working_getaddrinfo="yes" ])]) if test "$ac_cv_working_getaddrinfo" = "yes"; then - AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works well enough for APR]) + if test "$ac_cv_func_gai_strerror" != "yes"; then + ac_cv_working_getaddrinfo="no" + else + AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works well enough for APR]) + fi fi ]) diff --git a/configure.in b/configure.in index 3108d9e48..49fa19534 100644 --- a/configure.in +++ b/configure.in @@ -1319,7 +1319,9 @@ AC_ARG_ENABLE(ipv6, [ user_disabled_ipv6=0 ] ) AC_SEARCH_LIBS(getaddrinfo, inet6) +AC_SEARCH_LIBS(gai_strerror, inet6) AC_SEARCH_LIBS(getnameinfo, inet6) +AC_CHECK_FUNCS(gai_strerror) APR_CHECK_WORKING_GETADDRINFO APR_CHECK_NEGATIVE_EAI APR_CHECK_WORKING_GETNAMEINFO diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 8df92f553..bf6b26148 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -410,7 +410,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, return stuffbuffer(buf, bufsize, "APR does not understand this error code"); } else if (statcode < APR_OS_START_SYSERR) { -#if defined(HAVE_GETADDRINFO) +#if defined(HAVE_GAI_STRERROR) statcode -= APR_OS_START_EAIERR; #if defined(NEGATIVE_EAI) statcode = -statcode; |