From ddfaf2e5424abe7b7c901e991c3df1b9cf5835f0 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Tue, 15 Sep 2020 10:52:41 +0200 Subject: [PATCH] ntp: log error when SIOCSHWTSTAMP fails with EPERM Increase the severity of the log message to "error" when the SIOCSHWTSTAMP ioctl fails due missing the NET_ADMIN capability. --- ntp_io_linux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ntp_io_linux.c b/ntp_io_linux.c index 7be242f..02b59e1 100644 --- a/ntp_io_linux.c +++ b/ntp_io_linux.c @@ -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