From: Matthias Koenig Date: Mon, 2 Jun 2008 14:51:57 +0000 (+0200) Subject: hwclock: omit warning about drift if --noadjfile given X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b0beca2bbc88abd3d20a70a19a27b9c4fdaba4a;p=util-linux hwclock: omit warning about drift if --noadjfile given Currently, if hwclock is given the --noadjfile option it will nevertheless display information about the drift rate when invoked with the --debug option. Signed-off-by: Matthias Koenig --- diff --git a/hwclock/hwclock.c b/hwclock/hwclock.c index e2980fc8..6660a09a 100644 --- a/hwclock/hwclock.c +++ b/hwclock/hwclock.c @@ -1101,8 +1101,9 @@ manipulate_clock(const bool show, const bool adjust, const bool noadjfile, } else if (set) { set_hardware_clock_exact(set_time, startup_time, universal, testing); - adjust_drift_factor(&adjtime, set_time, hclock_valid, hclocktime, - time_diff(read_time, startup_time)); + if (!noadjfile) + adjust_drift_factor(&adjtime, set_time, hclock_valid, hclocktime, + time_diff(read_time, startup_time)); } else if (adjust) { do_adjustment(&adjtime, hclock_valid, hclocktime, read_time, universal, testing); @@ -1118,8 +1119,9 @@ manipulate_clock(const bool show, const bool adjust, const bool noadjfile, set_hardware_clock_exact((time_t) reftime.tv_sec, reftime, universal, testing); - adjust_drift_factor(&adjtime, (time_t) reftime.tv_sec, hclock_valid, - hclocktime, (double) read_time.tv_usec / 1E6); + if (!noadjfile) + adjust_drift_factor(&adjtime, (time_t) reftime.tv_sec, hclock_valid, + hclocktime, (double) read_time.tv_usec / 1E6); } else if (hctosys) { rc = set_system_clock(hclock_valid, hclocktime, testing); if (rc) {