diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-12-22 16:04:12 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-12-22 16:04:12 +0000 |
commit | a5d22c14aab0a9ed377a7114dd727e2fe54b7b47 (patch) | |
tree | 434156b021eecdbeff823b9b31e8c1bb67228f71 | |
parent | 398413ca256e232679d7abfa4c3a4d58ed55e8f9 (diff) |
d can be negative, take that into account when comparing to the logging
threshold. spotted by Constantine Murenin <mureninc@gmail.com>, mickey ok
-rw-r--r-- | usr.sbin/ntpd/ntpd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/ntpd.c b/usr.sbin/ntpd/ntpd.c index cd9b6297140..0224797028d 100644 --- a/usr.sbin/ntpd/ntpd.c +++ b/usr.sbin/ntpd/ntpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.c,v 1.26 2004/12/20 15:10:05 moritz Exp $ */ +/* $OpenBSD: ntpd.c,v 1.27 2004/12/22 16:04:11 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -306,7 +306,8 @@ ntpd_adjtime(double d) { struct timeval tv; - if (d >= (double)LOG_NEGLIGEE / 1000) + if (d >= (double)LOG_NEGLIGEE / 1000 || + d <= -1 * (double)LOG_NEGLIGEE / 1000) log_info("adjusting local clock by %fs", d); else log_debug("adjusting local clock by %fs", d); |