build: avoid getifaddrs when unavailable

pull/14127/head
Cory Fields 6 years ago committed by Lawrence Nahum
parent 2070a545e2
commit 9256f7d13f
No known key found for this signature in database
GPG Key ID: 17AB8BC320B151D8

@ -727,6 +727,10 @@ fi
AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h])
AC_CHECK_DECLS([getifaddrs, freeifaddrs],,,
[#include <sys/types.h>
#include <ifaddrs.h>]
)
AC_CHECK_DECLS([strnlen])
# Check for daemon(3), unrelated to --with-daemon (although used by it)

@ -2167,7 +2167,7 @@ void Discover()
}
}
}
#else
#elif (HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS)
// Get local host ip
struct ifaddrs* myaddrs;
if (getifaddrs(&myaddrs) == 0)

Loading…
Cancel
Save