X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet.c;h=b6ddc57193649f5e30a2e49e1ac47711347b803c;hb=e57daac63b6f703af8e7c8209ef61a4d3b2180c3;hp=92f6be861d0d31539022770fecc165485d87a705;hpb=332b55d4720fadea76c0a5d9b9d484af6a724006;p=tinc diff --git a/src/net.c b/src/net.c index 92f6be86..b6ddc571 100644 --- a/src/net.c +++ b/src/net.c @@ -36,6 +36,10 @@ #include "subnet.h" #include "xalloc.h" +#ifdef HAVE_RESOLV_H +#include +#endif + int contradicting_add_edge = 0; int contradicting_del_edge = 0; static int sleeptime = 10; @@ -309,6 +313,9 @@ static void sighup_handler(void *data) { static void sigalrm_handler(void *data) { logger(DEBUG_ALWAYS, LOG_NOTICE, "Got %s signal", strsignal(((signal_t *)data)->signum)); +#ifdef HAVE_DECL_RES_INIT + res_init(); +#endif retry(); } #endif @@ -458,7 +465,7 @@ int main_loop(void) { #endif if(!event_loop()) { - logger(DEBUG_ALWAYS, LOG_ERR, "Error while waiting for input: %s", strerror(errno)); + logger(DEBUG_ALWAYS, LOG_ERR, "Error while waiting for input: %s", sockstrerror(sockerrno)); return 1; }