From 1b3e51299e1c4d06f1eb43bd659d091f0178c8aa Mon Sep 17 00:00:00 2001 From: tholo Date: Wed, 23 Apr 1997 09:52:03 +0000 Subject: [PATCH] In nanosleep, use local error variable when storing rqtp in so that an error from a failed tsleep will still be returned to the caller; from jtc@NetBSD --- sys/kern/kern_time.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 149a9ca2ddc..c25a7558ec3 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_time.c,v 1.6 1997/04/20 20:49:42 tholo Exp $ */ +/* $OpenBSD: kern_time.c,v 1.7 1997/04/23 09:52:03 tholo Exp $ */ /* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */ /* @@ -217,6 +217,8 @@ sys_nanosleep(p, v, retval) error = 0; if (SCARG(uap, rmtp)) { + int error; + s = splclock(); utv = time; splx(s); @@ -228,6 +230,8 @@ sys_nanosleep(p, v, retval) TIMEVAL_TO_TIMESPEC(&utv,&rmt); error = copyout((caddr_t)&rmt, (caddr_t)SCARG(uap,rmtp), sizeof(rmt)); + if (error) + return (error); } return error; -- 2.20.1