diff options
author | ache <ache@FreeBSD.org> | 1997-10-20 18:43:49 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-10-20 18:43:49 +0000 |
commit | 29c82449218da633b6d747c8651d50a7a27699ae (patch) | |
tree | 410532b90295533e1451bc27df2b2f94f12b9f80 /sys/kern/kern_time.c | |
parent | 8e1cafde9c96f1f229edc2da01317f81dd4a4e3e (diff) | |
download | FreeBSD-src-29c82449218da633b6d747c8651d50a7a27699ae.zip FreeBSD-src-29c82449218da633b6d747c8651d50a7a27699ae.tar.gz |
Fix returned sleep period for large values
Submitted by: bde
Diffstat (limited to 'sys/kern/kern_time.c')
-rw-r--r-- | sys/kern/kern_time.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 7576d07..2baa9cf 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_time.c 8.1 (Berkeley) 6/10/93 - * $Id: kern_time.c,v 1.35 1997/09/21 22:00:16 gibbs Exp $ + * $Id: kern_time.c,v 1.36 1997/10/15 13:58:52 peter Exp $ */ #include <sys/param.h> @@ -269,11 +269,13 @@ nanosleep1(p, rqt, rmt) s = splclock(); utv = time; splx(s); + if (i != n) { + atv.tv_sec += (n - i - 1) * 100000000; + timevaladd(&atv, &rtv); + } timevalsub(&atv, &utv); if (atv.tv_sec < 0) timerclear(&atv); - if (n > 0) - atv.tv_sec += (n - i) * 100000000; TIMEVAL_TO_TIMESPEC(&atv, rmt); } } |