summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorThomas Nordin <nordin@cvs.openbsd.org>2004-06-26 05:52:21 +0000
committerThomas Nordin <nordin@cvs.openbsd.org>2004-06-26 05:52:21 +0000
commit62350eff27061c491174f2640abe01f312d6b059 (patch)
tree0c337363097a13a29990dc71a194a882f1e44639 /sys/kern
parent1b78c9699ad914864d387a652e35e477b232297d (diff)
Don't sleep forever on short nanosleeps.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_time.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 565b9eaef4f..a19bf4c56a0 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_time.c,v 1.43 2004/06/24 19:35:24 tholo Exp $ */
+/* $OpenBSD: kern_time.c,v 1.44 2004/06/26 05:52:20 nordin Exp $ */
/* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */
/*
@@ -234,7 +234,8 @@ sys_nanosleep(p, v, retval)
if (SCARG(uap, rmtp))
getnanouptime(&sts);
- error = tsleep(&nanowait, PWAIT | PCATCH, "nanosleep", tvtohz(&tv));
+ error = tsleep(&nanowait, PWAIT | PCATCH, "nanosleep",
+ MAX(1, tvtohz(&tv)));
if (error == ERESTART)
error = EINTR;
if (error == EWOULDBLOCK)