summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_time.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index ab86d059e79..8d6a8333f38 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_time.c,v 1.101 2018/02/19 08:59:52 mpi Exp $ */
+/* $OpenBSD: kern_time.c,v 1.102 2018/05/22 18:33:41 cheloha Exp $ */
/* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */
/*
@@ -268,7 +268,6 @@ sys_nanosleep(struct proc *p, void *v, register_t *retval)
struct timespec rqt, rmt;
struct timespec sts, ets;
struct timespec *rmtp;
- struct timeval tv;
int error, error1;
rmtp = SCARG(uap, rmtp);
@@ -283,15 +282,14 @@ sys_nanosleep(struct proc *p, void *v, register_t *retval)
}
#endif
- TIMESPEC_TO_TIMEVAL(&tv, &rqt);
- if (itimerfix(&tv))
+ if (rqt.tv_sec > 100000000 || timespecfix(&rqt))
return (EINVAL);
if (rmtp)
getnanouptime(&sts);
error = tsleep(&nanowait, PWAIT | PCATCH, "nanosleep",
- MAX(1, tvtohz(&tv)));
+ MAX(1, tstohz(&rqt)));
if (error == ERESTART)
error = EINTR;
if (error == EWOULDBLOCK)