]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
rtc: fix setting time from driftfile when RTC reading fails
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 3 Sep 2015 09:30:09 +0000 (11:30 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 3 Sep 2015 09:42:58 +0000 (11:42 +0200)
Fix RTC_Linux_TimePreInit() to return 0 when the RTC device can be
opened, but reading its time fails to at least have the time restored
from the driftfile.

rtc_linux.c

index 40befb35d19b924a4431cb65614cb818ee246b8e..16f77c4334c22138f8ccdb3c72ec300f34218d74 100644 (file)
@@ -1051,6 +1051,8 @@ RTC_Linux_TimePreInit(void)
       LOG(LOGS_WARN, LOGF_RtcLinux, "Could not convert RTC reading to seconds since 1/1/1970");
       return 0;
     }
+  } else {
+    return 0;
   }
 
   return 1;