summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2005-12-14 06:54:39 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2005-12-14 06:54:39 +0000
commitaf7a959013caf2c5c267715ae41cd8d7cc91c721 (patch)
tree63783c8a52af16a473295e6ac2ec3761d09b6888 /sys/kern
parent32eefeb935d95a67efef35682775d19eacb04ae6 (diff)
timeout code is not so happy with the negative values
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_synch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 21ad002de37..53ba0df6578 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_synch.c,v 1.70 2005/12/14 04:03:51 tedu Exp $ */
+/* $OpenBSD: kern_synch.c,v 1.71 2005/12/14 06:54:38 tedu Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*
@@ -412,6 +412,8 @@ sys_thrsleep(struct proc *p, void *v, register_t *revtal)
timo = timo * (hz / 1000);
else
timo = timo / (1000 / hz);
+ if (timo < 0)
+ timo = 0;
error = tsleep(n, PUSER | PCATCH, "thrsleep", timo);
return (error);