Default to set TZ=UTC0 for RTC plugin

This patch sets the TZ variable to a sane default, UTC.  Fixing, at
least, the time restore problems of the RTC plugin.

Also, let the C library figure out DST, as the docs say -1 does ...

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2020-04-26 21:38:07 +02:00
1 parent 5fd5e722a8
commit 54fd38adcc
2 files changed
+6 -1

No files matched your search

+1
View File
@@ -118,6 +118,7 @@ static void rtc_restore(void *arg)
}
print_desc(NULL, "Restoring system clock (UTC) from RTC");
tm.tm_isdst = -1; /* Use tzdata to figure it out, please. */
tv.tv_sec = mktime(&tm);
if (tv.tv_sec < RTC_TIMESTAMP_BEGIN_2000) {
errno = EINVAL;