From 4ba19a2f79dc04d780b6450fbce66d07430ceb37 Mon Sep 17 00:00:00 2001 From: J William Piggott Date: Fri, 28 Jul 2017 20:48:01 -0400 Subject: [PATCH] hwclock: move systz above init clocks read The systz option is all about speed, so move it to the top and simplify the init clocks read test. Signed-off-by: J William Piggott --- sys-utils/hwclock.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c index c74e0e2649..cec712d891 100644 --- a/sys-utils/hwclock.c +++ b/sys-utils/hwclock.c @@ -1046,8 +1046,11 @@ manipulate_clock(const struct hwclock_control *ctl, const time_t set_time, adjtime->dirty = TRUE; } + if (ctl->systz) + return set_system_clock_timezone(ctl); + if (ctl->show || ctl->get || ctl->adjust || ctl->hctosys - || (!ctl->noadjfile && !ctl->systz && !ctl->predict)) { + || (!ctl->noadjfile && !ctl->predict)) { /* data from HW-clock are required */ rc = synchronize_to_clock_tick(ctl); @@ -1123,8 +1126,6 @@ manipulate_clock(const struct hwclock_control *ctl, const time_t set_time, hclock_valid, hclocktime); } else if (ctl->hctosys) { return set_system_clock(ctl, hclock_valid, hclocktime); - } else if (ctl->systz) { - return set_system_clock_timezone(ctl); } else if (ctl->predict) { hclocktime = time_inc(hclocktime, (double) -(tdrift.tv_sec + tdrift.tv_usec / 1E6)); -- 2.47.3