diff options
author | wollman <wollman@FreeBSD.org> | 1994-09-29 00:52:06 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1994-09-29 00:52:06 +0000 |
commit | 3418b20e52d057b509376ac4df4cda6d5feafde6 (patch) | |
tree | 571e39a640bf56977e75ce3fed800f46a8afff1d | |
parent | f04cd875db57bab1fabc1d6f28c086e2fcaaef32 (diff) | |
download | FreeBSD-src-3418b20e52d057b509376ac4df4cda6d5feafde6.zip FreeBSD-src-3418b20e52d057b509376ac4df4cda6d5feafde6.tar.gz |
Fixed bug in hardclock() that caused adjtime() to fail when given
a negative offset. This would be seen in xntpd as a rash of
``Previous time adjustment didn't complete'' messages on startup.
-rw-r--r-- | sys/kern/kern_clock.c | 13 | ||||
-rw-r--r-- | sys/kern/kern_tc.c | 13 | ||||
-rw-r--r-- | sys/kern/kern_timeout.c | 13 |
3 files changed, 12 insertions, 27 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index d72c284..cb67a90 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.6 1994/09/18 20:39:46 wollman Exp $ + * $Id: kern_clock.c,v 1.7 1994/09/25 19:33:34 phk Exp $ */ /* Portions of this software are covered by the following: */ @@ -467,15 +467,10 @@ hardclock(frame) long ltemp; if (timedelta == 0) { - time_update = tick; + time_update = tick; } else { - if (timedelta < 0) { - time_update = tick - tickdelta; - timedelta += tickdelta; - } else { - time_update = tick + tickdelta; - timedelta -= tickdelta; - } + time_update = tick + tickdelta; + timedelta -= tickdelta; } BUMPTIME(&mono_time, time_update); diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index d72c284..cb67a90 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.6 1994/09/18 20:39:46 wollman Exp $ + * $Id: kern_clock.c,v 1.7 1994/09/25 19:33:34 phk Exp $ */ /* Portions of this software are covered by the following: */ @@ -467,15 +467,10 @@ hardclock(frame) long ltemp; if (timedelta == 0) { - time_update = tick; + time_update = tick; } else { - if (timedelta < 0) { - time_update = tick - tickdelta; - timedelta += tickdelta; - } else { - time_update = tick + tickdelta; - timedelta -= tickdelta; - } + time_update = tick + tickdelta; + timedelta -= tickdelta; } BUMPTIME(&mono_time, time_update); diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index d72c284..cb67a90 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.6 1994/09/18 20:39:46 wollman Exp $ + * $Id: kern_clock.c,v 1.7 1994/09/25 19:33:34 phk Exp $ */ /* Portions of this software are covered by the following: */ @@ -467,15 +467,10 @@ hardclock(frame) long ltemp; if (timedelta == 0) { - time_update = tick; + time_update = tick; } else { - if (timedelta < 0) { - time_update = tick - tickdelta; - timedelta += tickdelta; - } else { - time_update = tick + tickdelta; - timedelta -= tickdelta; - } + time_update = tick + tickdelta; + timedelta -= tickdelta; } BUMPTIME(&mono_time, time_update); |