diff options
-rw-r--r-- | sys/kern/kern_clock.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index f1227743ac1..718cdb9d6e9 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_clock.c,v 1.66 2008/03/15 21:21:09 miod Exp $ */ +/* $OpenBSD: kern_clock.c,v 1.67 2008/10/04 15:21:59 deraadt Exp $ */ /* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */ /*- @@ -166,6 +166,11 @@ initclocks(void) if (profhz == 0) profhz = i; psratio = profhz / i; + + /* For very large HZ, ensure that division by 0 does not occur later */ + if (tickadj == 0) + tickadj = 1; + #ifdef __HAVE_TIMECOUNTER inittimecounter(); #endif |