1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-18 15:30:21 +00:00

More fixes for the iterative case of nanosleep1 from bruce.

I hate the 2-arg time{spec|val}{add|sub} functions!
This commit is contained in:
Poul-Henning Kamp 1998-04-05 12:10:41 +00:00
parent bfe6c9fabf
commit 5704ba6a06
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=35045

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_time.c 8.1 (Berkeley) 6/10/93
* $Id: kern_time.c,v 1.49 1998/04/05 11:17:19 peter Exp $
* $Id: kern_time.c,v 1.50 1998/04/05 11:49:36 phk Exp $
*/
#include <sys/param.h>
@ -194,7 +194,7 @@ nanosleep1(p, rqt, rmt)
struct proc *p;
struct timespec *rqt, *rmt;
{
struct timespec ts, ts2;
struct timespec ts, ts2, ts3;
struct timeval tv;
int error;
@ -222,9 +222,9 @@ nanosleep1(p, rqt, rmt)
}
if (timespeccmp(&ts2, &ts, >=))
return (0);
getnanoruntime(&ts2);
timespecsub(&ts2, &ts);
TIMESPEC_TO_TIMEVAL(&tv, &ts2);
ts3 = ts;
timespecsub(&ts3, &ts2);
TIMESPEC_TO_TIMEVAL(&tv, &ts3);
}
}