]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: don't log error when socket() fails for client only socket
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 14 Apr 2015 13:59:55 +0000 (15:59 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 14 Apr 2015 13:59:55 +0000 (15:59 +0200)
ntp_io.c

index 7053c4e7da1f0c462d0492daf3ff07e2c0d23e64..571292a8cd150fc1d88d90442cfa814bfa1cf3f0 100644 (file)
--- a/ntp_io.c
+++ b/ntp_io.c
@@ -97,8 +97,13 @@ prepare_socket(int family, int port_number, int client_only)
   sock_fd = socket(family, SOCK_DGRAM, 0);
 
   if (sock_fd < 0) {
-    LOG(LOGS_ERR, LOGF_NtpIO, "Could not open %s NTP socket : %s",
-        family == AF_INET ? "IPv4" : "IPv6", strerror(errno));
+    if (!client_only) {
+      LOG(LOGS_ERR, LOGF_NtpIO, "Could not open %s NTP socket : %s",
+          family == AF_INET ? "IPv4" : "IPv6", strerror(errno));
+    } else {
+      DEBUG_LOG(LOGF_NtpIO, "Could not open %s NTP socket : %s",
+                family == AF_INET ? "IPv4" : "IPv6", strerror(errno));
+    }
     return INVALID_SOCK_FD;
   }