From 7d6de7afe680bababef4421250c7af62d643aa14 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Thu, 3 Sep 2015 11:30:09 +0200 Subject: [PATCH] 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. --- rtc_linux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rtc_linux.c b/rtc_linux.c index 40befb3..16f77c4 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;