From 0b0beca2bbc88abd3d20a70a19a27b9c4fdaba4a Mon Sep 17 00:00:00 2001 From: Matthias Koenig Date: Mon, 2 Jun 2008 16:51:57 +0200 Subject: [PATCH] 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 --- hwclock/hwclock.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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) { -- 2.39.5