From 43b41e9095e6261c53da1ae46117d018296c3b68 Mon Sep 17 00:00:00 2001 From: Etienne Dechamps Date: Sat, 14 Mar 2015 16:17:32 +0000 Subject: [PATCH] Fix HAVE_DECL_RES_INIT conditionals. HAVE_DECL_RES_INIT is generated using AC_CHECK_DECLS. tinc checks this symbol using #ifdef, which is wrong because (according to autoconf docs) the symbol is always defined, it's just set to zero if the check failed. This broke the Windows build starting from 0b310bf406dbe58afe37fa31156b9ea47599d7be, because it introduced this conditional in code that's not excluded from the Windows build. --- src/net_setup.c | 2 +- src/netutl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net_setup.c b/src/net_setup.c index d1d5c04b..3ed6fbb0 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -664,7 +664,7 @@ static bool add_listen_address(char *address, bool bindto) { hint.ai_protocol = IPPROTO_TCP; hint.ai_flags = AI_PASSIVE; -#ifdef HAVE_DECL_RES_INIT +#if HAVE_DECL_RES_INIT res_init(); #endif int err = getaddrinfo(address && *address ? address : NULL, port, &hint, &ai); diff --git a/src/netutl.c b/src/netutl.c index 3ea5d4a2..bff734e1 100644 --- a/src/netutl.c +++ b/src/netutl.c @@ -39,7 +39,7 @@ struct addrinfo *str2addrinfo(const char *address, const char *service, int sock hint.ai_family = addressfamily; hint.ai_socktype = socktype; -#ifdef HAVE_DECL_RES_INIT +#if HAVE_DECL_RES_INIT res_init(); #endif err = getaddrinfo(address, service, &hint, &ai); -- 2.20.1