]> err.no Git - util-linux/commitdiff
hwclock: omit warning about drift if --noadjfile given
authorMatthias Koenig <mkoenig@suse.de>
Mon, 2 Jun 2008 14:51:57 +0000 (16:51 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 2 Jul 2008 13:07:25 +0000 (15:07 +0200)
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 <mkoenig@suse.de>
hwclock/hwclock.c

index e2980fc85f2e43c234e8fd97e6c3e187ccb78f00..6660a09a8ece7e0a79400d4069acecdd57af6611 100644 (file)
@@ -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) {