]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
tempcomp: print warning message on error
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 20 Mar 2014 12:47:08 +0000 (13:47 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 21 Mar 2014 12:20:24 +0000 (13:20 +0100)
logging.h
tempcomp.c

index 2015c7340787af881618e6321f0e989999d12e11..2b247b4c6da34021e3579e5e0c36b4662cfe7b9b 100644 (file)
--- a/logging.h
+++ b/logging.h
@@ -85,6 +85,7 @@ typedef enum {
   LOGF_SysSolaris,
   LOGF_SysSunOS,
   LOGF_SysWinnt,
+  LOGF_TempComp,
   LOGF_RtcLinux,
   LOGF_Refclock
 } LOG_Facility;
index e4fefedf4b3c3588197f7d01ad89fc6f603198b4..4506c2f77b58566b4a38973a28cda3e3c2c8fbff 100644 (file)
@@ -67,7 +67,14 @@ read_timeout(void *arg)
         LOG_FileWrite(logfileid, "%s %11.4e %11.4e",
             UTI_TimeToLogForm(now.tv_sec), temp, comp);
       }
+    } else {
+      LOG(LOGS_WARN, LOGF_TempComp,
+          "Temperature compensation of %.3f ppm exceeds sanity limit of %.1f",
+          comp, MAX_COMP);
     }
+  } else {
+    LOG(LOGS_WARN, LOGF_TempComp, "Could not read temperature from %s",
+        filename);
   }
 
   if (f)