]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: log error when SIOCSHWTSTAMP fails with EPERM
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 15 Sep 2020 08:52:41 +0000 (10:52 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 16 Sep 2020 09:15:29 +0000 (11:15 +0200)
Increase the severity of the log message to "error" when
the SIOCSHWTSTAMP ioctl fails due missing the NET_ADMIN capability.

ntp_io_linux.c

index 7be242faf141edab5d125edd886a910a28dfabd0..02b59e17beff65bfea67dffdaa1fae8afb60ddca 100644 (file)
@@ -200,7 +200,8 @@ add_interface(CNF_HwTsInterface *conf_iface)
   req.ifr_data = (char *)&ts_config;
 
   if (ioctl(sock_fd, SIOCSHWTSTAMP, &req)) {
-    DEBUG_LOG("ioctl(%s) failed : %s", "SIOCSHWTSTAMP", strerror(errno));
+    LOG(errno == EPERM ? LOGS_ERR : LOGS_DEBUG,
+        "ioctl(%s) failed : %s", "SIOCSHWTSTAMP", strerror(errno));
 
     /* Check the current timestamping configuration in case this interface
        allows only reading of the configuration and it was already configured