From: Miroslav Lichvar Date: Thu, 3 Sep 2015 09:30:09 +0000 (+0200) Subject: rtc: fix setting time from driftfile when RTC reading fails X-Git-Tag: 2.2-pre1~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d6de7afe680bababef4421250c7af62d643aa14;p=thirdparty%2Fchrony.git rtc: fix setting time from driftfile when RTC reading fails 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. --- diff --git a/rtc_linux.c b/rtc_linux.c index 40befb35..16f77c43 100644 --- a/rtc_linux.c +++ b/rtc_linux.c @@ -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;