summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_clock.c
diff options
context:
space:
mode:
authortholo <tholo@openbsd.org>1997-01-25 23:35:58 +0000
committertholo <tholo@openbsd.org>1997-01-25 23:35:58 +0000
commit56c28e0e23dde4b672005ca7ffd1a4ff42243ef3 (patch)
treeb5dae254c0f19706fc9a99512df0d713758ae7c2 /sys/kern/kern_clock.c
parentImprove adjtime() for odd hz values; from Dennis Ferguson (NetBSD PR# 2787) (diff)
downloadwireguard-openbsd-56c28e0e23dde4b672005ca7ffd1a4ff42243ef3.tar.xz
wireguard-openbsd-56c28e0e23dde4b672005ca7ffd1a4ff42243ef3.zip
Don't do disruptive time corrections if tick size is not integral; from
Dennis Ferguson (NetBSD PR #2788)
Diffstat (limited to 'sys/kern/kern_clock.c')
-rw-r--r--sys/kern/kern_clock.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index d2a8ae4462f..45ea1f52e6e 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_clock.c,v 1.14 1997/01/25 23:31:47 tholo Exp $ */
+/* $OpenBSD: kern_clock.c,v 1.15 1997/01/25 23:35:58 tholo Exp $ */
/* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */
/*-
@@ -284,7 +284,7 @@ static int psdiv, pscnt; /* prof => stat divider */
int psratio; /* ratio: prof / stat */
int tickfix, tickfixinterval; /* used if tick not really integral */
#ifndef NTP
-static int tickfixcnt; /* number of ticks since last fix */
+static int tickfixcnt; /* accumulated fractional error */
#else
int fixtick; /* used by NTP for same */
int shifthz;
@@ -415,10 +415,10 @@ hardclock(frame)
#ifndef NTP
if (tickfix) {
- tickfixcnt++;
+ tickfixcnt += tickfix;
if (tickfixcnt >= tickfixinterval) {
- delta += tickfix;
- tickfixcnt = 0;
+ delta++;
+ tickfixcnt -= tickfixinterval;
}
}
#else