From: Azat Khuzhin Date: Wed, 25 Nov 2015 14:47:42 +0000 (+0300) Subject: autotools: fix getservbyname() detection X-Git-Tag: release-2.1.6-beta~90^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=959a4c208c793d59ac7d5a7b796643037686b647;p=libevent autotools: fix getservbyname() detection 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.") --- diff --git a/configure.ac b/configure.ac index a0634ed7..6a669fb7 100644 --- a/configure.ac +++ b/configure.ac @@ -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.)