summaryrefslogtreecommitdiffstats
path: root/sys-utils/hwclock.c
diff options
context:
space:
mode:
authorJ William Piggott2017-07-29 02:48:01 +0200
committerJ William Piggott2017-08-04 14:53:44 +0200
commit4ba19a2f79dc04d780b6450fbce66d07430ceb37 (patch)
tree51b87a04c93c07c3ce264098c9a985f9e5fdd6ad /sys-utils/hwclock.c
parentlibblkid: add support for UBI superblock (diff)
downloadkernel-qcow2-util-linux-4ba19a2f79dc04d780b6450fbce66d07430ceb37.tar.gz
kernel-qcow2-util-linux-4ba19a2f79dc04d780b6450fbce66d07430ceb37.tar.xz
kernel-qcow2-util-linux-4ba19a2f79dc04d780b6450fbce66d07430ceb37.zip
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 <elseifthen@gmx.com>
Diffstat (limited to 'sys-utils/hwclock.c')
-rw-r--r--sys-utils/hwclock.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index c74e0e264..cec712d89 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));