diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1997-04-23 09:52:04 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1997-04-23 09:52:04 +0000 |
commit | 486a63601646f47c543755a29f276d84b9938141 (patch) | |
tree | e1a185407f247e5d8806a3035de32760b1e75f74 | |
parent | 424bdbe51a67b42e902da8f18c0bdc83190d552e (diff) |
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
-rw-r--r-- | sys/kern/kern_time.c | 6 |
1 files changed, 5 insertions, 1 deletions
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; |