From: J William Piggott Date: Sat, 29 Jul 2017 00:48:01 +0000 (-0400) Subject: hwclock: move systz above init clocks read X-Git-Tag: v2.31-rc1~144^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ba19a2f79dc04d780b6450fbce66d07430ceb37;p=thirdparty%2Futil-linux.git 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 --- 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));