From: Miroslav Lichvar Date: Wed, 17 Jul 2013 11:45:36 +0000 (+0200) Subject: Treat address bind errors as non-fatal X-Git-Tag: 1.28~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6a39d75a776d38d492b9ab1b5405d022a8e1d2e;p=thirdparty%2Fchrony.git Treat address bind errors as non-fatal --- diff --git a/cmdmon.c b/cmdmon.c index dd78afa0..75bc4646 100644 --- a/cmdmon.c +++ b/cmdmon.c @@ -248,8 +248,10 @@ prepare_socket(int family) } if (bind(sock_fd, &my_addr.u, my_addr_len) < 0) { - LOG_FATAL(LOGF_CmdMon, "Could not bind %s command socket : %s", + LOG(LOGS_ERR, LOGF_CmdMon, "Could not bind %s command socket : %s", family == AF_INET ? "IPv4" : "IPv6", strerror(errno)); + close(sock_fd); + return -1; } /* Register handler for read events on the socket */ diff --git a/ntp_io.c b/ntp_io.c index 9924056c..0e7aa737 100644 --- a/ntp_io.c +++ b/ntp_io.c @@ -210,8 +210,10 @@ prepare_socket(int family) #endif if (bind(sock_fd, &my_addr.u, my_addr_len) < 0) { - LOG_FATAL(LOGF_NtpIO, "Could not bind %s NTP socket : %s", + LOG(LOGS_ERR, LOGF_NtpIO, "Could not bind %s NTP socket : %s", family == AF_INET ? "IPv4" : "IPv6", strerror(errno)); + close(sock_fd); + return -1; } /* Register handler for read events on the socket */