]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
rtc: cleanup in error messages
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 18 Aug 2014 09:03:15 +0000 (11:03 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 18 Aug 2014 15:21:26 +0000 (17:21 +0200)
rtc.c
rtc_linux.c

diff --git a/rtc.c b/rtc.c
index 490017907b07d4120a4e7e533bffeab723f9e3f9..5b2ccf99959012cdd9195820e9d340dceac4d8a6 100644 (file)
--- a/rtc.c
+++ b/rtc.c
@@ -77,7 +77,8 @@ void
 RTC_Initialise(void)
 {
   char *file_name;
-  int ok;
+
+  driver_initialised = 0;
 
   /* This is how we tell whether the user wants to load the RTC
      driver, if he is on a machine where it is an option. */
@@ -90,23 +91,11 @@ RTC_Initialise(void)
 
     if (driver.init) {
       if ((driver.init)()) {
-        ok = 1;
-      } else {
-        ok = 0;
+        driver_initialised = 1;
       }
     } else {
-      ok = 0;
-    }
-
-    if (ok) {
-      driver_initialised = 1;
-    } else {
-      driver_initialised = 0;
-      LOG(LOGS_ERR, LOGF_Rtc, "Real time clock not supported on this operating system");
+      LOG(LOGS_ERR, LOGF_Rtc, "RTC not supported on this operating system");
     }
-
-  } else {
-    driver_initialised = 0;
   }
 }
 
@@ -137,7 +126,6 @@ RTC_TimeInit(void (*after_hook)(void *), void *anything)
   if (driver_initialised) {
     (driver.time_init)(after_hook, anything);
   } else {
-    LOG(LOGS_ERR, LOGF_Rtc, "Can't initialise from real time clock, driver not loaded");
     (after_hook)(anything);
   }
 }
index b87d8f34ad5bb95a241877cc22b2cd14016eeafe..1993be23d77c5807fe65bb6bd26d085756945b70 100644 (file)
@@ -456,9 +456,6 @@ read_coefs_from_file(void)
             coefs_file_name);
       }
       fclose(in);
-    } else {
-      LOG(LOGS_WARN, LOGF_RtcLinux, "Could not open RTC file %s for reading",
-          coefs_file_name);
     }
   }
 }
@@ -550,7 +547,8 @@ RTC_Linux_Initialise(void)
 
   fd = open (CNF_GetRtcDevice(), O_RDWR);
   if (fd < 0) {
-    LOG(LOGS_ERR, LOGF_RtcLinux, "Could not open %s, %s", CNF_GetRtcDevice(), strerror(errno));
+    LOG(LOGS_ERR, LOGF_RtcLinux, "Could not open RTC device %s : %s",
+        CNF_GetRtcDevice(), strerror(errno));
     return 0;
   }