diff options
author | Patrick Oppenlander <patrick.oppenlander@gmail.com> | 2020-10-15 12:51:10 +1100 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-10-15 23:02:30 -0500 |
commit | 29229bf0fdebfbc7fe5088a073dd74d0ea57dc3b (patch) | |
tree | b6fe350f8bd78d1d0646d9fc77eef9fd5c9130d0 /toys/other | |
parent | 55edd44d8f351606b948347c1c78263c054eaf89 (diff) | |
download | toybox-29229bf0fdebfbc7fe5088a073dd74d0ea57dc3b.tar.gz |
rtcwake: default to UTC if /etc/adjtime can't be read
This is consistent with the util-linux implementation.
Diffstat (limited to 'toys/other')
-rw-r--r-- | toys/other/rtcwake.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/other/rtcwake.c b/toys/other/rtcwake.c index 161bd881..a382ee57 100644 --- a/toys/other/rtcwake.c +++ b/toys/other/rtcwake.c @@ -55,7 +55,7 @@ void rtcwake_main(void) if (FLAG(u)) utc = 1; else if (FLAG(l)) utc = 0; - else utc = !!strstr(xreadfile("/etc/adjtime", toybuf, 2048), "UTC"); + else utc = !readfile("/etc/adjtime", toybuf, 2048) || !!strstr(toybuf, "UTC"); if (FLAG(v)) xprintf("RTC time: %s\n", utc ? "UTC" : "local"); if (!TT.d) TT.d = "/dev/rtc0"; |