From d1e706f6f9d558f6d17c4d2a2f973eb0049024fb Mon Sep 17 00:00:00 2001 From: henning <> Date: Wed, 22 Dec 2004 16:04:11 +0000 Subject: [PATCH] d can be negative, take that into account when comparing to the logging threshold. spotted by Constantine Murenin , mickey ok --- src/usr.sbin/ntpd/ntpd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c index cd9b6297..02247970 100644 --- a/src/usr.sbin/ntpd/ntpd.c +++ b/src/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 @@ -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);