]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Treat address bind errors as non-fatal
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 17 Jul 2013 11:45:36 +0000 (13:45 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 17 Jul 2013 11:45:36 +0000 (13:45 +0200)
cmdmon.c
ntp_io.c

index dd78afa0d4bcd37097dcfb678b75745ce6aaea60..75bc464600ca6562ad5fedc93894d23dee6bd733 100644 (file)
--- 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 */
index 9924056c8e9ad54622f80d0057029c6a039d82b8..0e7aa737f4a0e62aa34a04b94281d0f714e9e1c6 100644 (file)
--- 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 */