summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-04-13 21:04:53 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-04-13 21:04:53 +0000
commit76d25956cde99e641b7aaa8a176dce7b79792bd9 (patch)
tree5a8cc37137afe7c7fac45d41d48999ddb18cb7ce /sys/kern
parente853ecbe6e88ad03301698f4dfe091164c32e141 (diff)
diff from nordin@ to prevent wraparound on long uptime machines.
ok art@ deraadt@ miod@ tdeval@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_timeout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c
index 1eab246a84f..cdd5b5c250a 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_timeout.c,v 1.15 2002/12/08 04:21:07 art Exp $ */
+/* $OpenBSD: kern_timeout.c,v 1.16 2003/04/13 21:04:52 tedu Exp $ */
/*
* Copyright (c) 2001 Thomas Nordin <nordin@openbsd.org>
* Copyright (c) 2000-2001 Artur Grabowski <art@openbsd.org>
@@ -177,7 +177,7 @@ timeout_add(struct timeout *new, int to_ticks)
* and let it be rescheduled later.
*/
if (new->to_flags & TIMEOUT_ONQUEUE) {
- if (new->to_time < old_time) {
+ if (new->to_time - ticks < old_time - ticks) {
CIRCQ_REMOVE(&new->to_list);
CIRCQ_INSERT(&new->to_list, &timeout_todo);
}