diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-05-08 01:29:00 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-05-08 01:29:00 +0000 |
commit | 7d48286dcf6527850384e61dfce493e16908871f (patch) | |
tree | aa0f6a455793eac0874da66ac9c2d67a2fc0ad8a /sys/kern | |
parent | e8d07c61eee9534040422948663255d4fb718e29 (diff) |
from art@:
in timeout_hardclock_update() check out if there is
anything in the timeout queue before calculating the return value.
thanks to Adam Rogoyski <rogoyski@cs.utexas.edu> for
debugging and testing help.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_timeout.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 7ef15bb9f82..2ef8ecffe3a 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_timeout.c,v 1.3 2000/03/23 11:07:34 art Exp $ */ +/* $OpenBSD: kern_timeout.c,v 1.4 2000/05/08 01:28:59 mickey Exp $ */ /* * Copyright (c) 2000 Artur Grabowski <art@openbsd.org> * All rights reserved. @@ -175,7 +175,14 @@ timeout_del(to) int timeout_hardclock_update() { - return (TAILQ_FIRST(&timeout_todo)->to_time - ticks <= 0); + struct timeout *to; + + to = TAILQ_FIRST(&timeout_todo); + + if (to == NULL) + return 0; + + return (to->to_time - ticks <= 0); } void |