]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: move systz above init clocks read
authorJ William Piggott <elseifthen@gmx.com>
Sat, 29 Jul 2017 00:48:01 +0000 (20:48 -0400)
committerJ William Piggott <elseifthen@gmx.com>
Fri, 4 Aug 2017 12:53:44 +0000 (08:53 -0400)
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 <elseifthen@gmx.com>
sys-utils/hwclock.c

index c74e0e2649729aabd2a3a047689f742a74815413..cec712d891f2a7d1cc56d4386d1e2ea63ce99c90 100644 (file)
@@ -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));