Browse Source

d can be negative, take that into account when comparing to the logging

threshold. spotted by Constantine Murenin <mureninc@gmail.com>, mickey ok
OPENBSD_3_7
henning 20 years ago
parent
commit
d1e706f6f9
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/usr.sbin/ntpd/ntpd.c

+ 3
- 2
src/usr.sbin/ntpd/ntpd.c View File

@ -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> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -306,7 +306,8 @@ ntpd_adjtime(double d)
{ {
struct timeval tv; 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); log_info("adjusting local clock by %fs", d);
else else
log_debug("adjusting local clock by %fs", d); log_debug("adjusting local clock by %fs", d);


Loading…
Cancel
Save