summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_synch.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 6b10a95e5b9..caa939353e7 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_synch.c,v 1.101 2012/03/23 15:51:26 guenther Exp $ */
+/* $OpenBSD: kern_synch.c,v 1.102 2012/04/10 11:33:58 guenther Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*
@@ -455,11 +455,9 @@ sys___thrsleep(struct proc *p, void *v, register_t *retval)
timespecsub(&ats, &now, &ats);
to_ticks = (long long)hz * ats.tv_sec +
- ats.tv_nsec / (tick * 1000);
+ (ats.tv_nsec + tick * 1000 - 1) / (tick * 1000) + 1;
if (to_ticks > INT_MAX)
to_ticks = INT_MAX;
- if (to_ticks == 0)
- to_ticks = 1;
}
p->p_thrslpid = ident;