[PATCH] hwclock: omit warning about drift if --noadjfile given | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
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@xxxxxxx>
---
hwclock/hwclock.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/hwclock/hwclock.c b/hwclock/hwclock.c
index f138a9f..501452b 100644
--- a/hwclock/hwclock.c
+++ b/hwclock/hwclock.c
@@ -1099,8 +1099,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);
@@ -1116,8 +1117,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) {
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Site Home] [Netdev] [Ethernet Bridging] [Linux Wireless] [Kernel Newbies] [Memory] [Security] [Linux for Hams] [Netfilter] [Bugtraq] [Rubini] [Photo] [Yosemite] [Yosemite News] [MIPS Linux] [ARM Linux] [Linux RAID] [Linux Admin] [Samba] [Video 4 Linux] [Linux Resources]