]> granicus.if.org Git - libevent/commitdiff
autotools: fix getservbyname() detection
authorAzat Khuzhin <a3at.mail@gmail.com>
Wed, 25 Nov 2015 14:47:42 +0000 (17:47 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Wed, 25 Nov 2015 15:16:29 +0000 (18:16 +0300)
The mentioned commit adds this check under-the-else of the previous condition
between getaddrinfo()/gethostbyname_r(), so this check is triggered only when
we don't have getaddrinfo() which is wrong, fix this by move it upper.

Fixes [CI] since it uses getservbyname() and it failed with autotools only
(cmake detection is ok).

CI: https://travis-ci.org/libevent/libevent/builds/93125954
Fixes: af08a94085e49e6942835b4c6b50a774536d5b5b ("Check for getservbyname even
if not on win32.")

configure.ac

index a0634ed767b9e13f99c857e2c18f1a09fea523df..6a669fb7015c290d27fc3e061af17eadbcc5e626 100644 (file)
@@ -369,6 +369,7 @@ AC_CHECK_FUNCS([ \
   unsetenv \
   usleep \
   vasprintf \
+  getservbyname \
 ])
 AM_CONDITIONAL(STRLCPY_IMPL, [test x"$ac_cv_func_strlcpy" = xno])
 
@@ -394,7 +395,6 @@ if test "$libevent_cv_getaddrinfo" = "yes" ; then
     AC_DEFINE([HAVE_GETADDRINFO], [1], [Do we have getaddrinfo()?])
 else
 
-AC_CHECK_FUNCS([getservbyname])
 # Check for gethostbyname_r in all its glorious incompatible versions.
 #   (This is cut-and-pasted from Tor, which based its logic on
 #   Python's configure.in.)