aboutsummaryrefslogtreecommitdiff
path: root/toys/other
diff options
context:
space:
mode:
Diffstat (limited to 'toys/other')
-rw-r--r--toys/other/hwclock.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/toys/other/hwclock.c b/toys/other/hwclock.c
index ba28cc3d..a6db923a 100644
--- a/toys/other/hwclock.c
+++ b/toys/other/hwclock.c
@@ -40,10 +40,8 @@ void hwclock_main()
if (FLAG(u)) utc = 1;
else if (FLAG(l)) utc = 0;
- else {
- xreadfile("/etc/adjtime", toybuf, sizeof(toybuf));
- utc = !!strstr(toybuf, "UTC");
- }
+ else utc = !readfile("/etc/adjtime", toybuf, sizeof(toybuf)) ||
+ !!strstr(toybuf, "UTC");
if (!FLAG(t)) {
if (!TT.f) TT.f = "/dev/rtc0";