diff options
author | peter <peter@FreeBSD.org> | 1998-04-05 11:17:19 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1998-04-05 11:17:19 +0000 |
commit | 0a735b082983008f24ff06773efbd285533ce93a (patch) | |
tree | 877e67c376eb22c8053ccdcf89ba2d58c93d84eb /sys/kern/kern_time.c | |
parent | 08f33aeded605c5dc7a5222be34dc3ccd84a15c2 (diff) | |
download | FreeBSD-src-0a735b082983008f24ff06773efbd285533ce93a.zip FreeBSD-src-0a735b082983008f24ff06773efbd285533ce93a.tar.gz |
If there is no error code, don't copyout the remaining time. (As
documented in the man page and the standards). (and besides, nanosleep1
isn't setting it in this case at present anyway, so we'd be copying junk).
Diffstat (limited to 'sys/kern/kern_time.c')
-rw-r--r-- | sys/kern/kern_time.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 49b7afb..b8da9b0 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.47 1998/04/05 07:31:44 peter Exp $ + * $Id: kern_time.c,v 1.48 1998/04/05 10:28:01 phk Exp $ */ #include <sys/param.h> @@ -255,7 +255,7 @@ nanosleep(p, uap) if (!useracc((caddr_t)SCARG(uap, rmtp), sizeof(rmt), B_WRITE)) return (EFAULT); error = nanosleep1(p, &rqt, &rmt); - if (SCARG(uap, rmtp)) { + if (error && SCARG(uap, rmtp)) { error2 = copyout(&rmt, SCARG(uap, rmtp), sizeof(rmt)); if (error2) /* XXX shouldn't happen, did useracc() above */ return (error2); @@ -296,7 +296,7 @@ signanosleep(p, uap) error = nanosleep1(p, &rqt, &rmt); - if (SCARG(uap, rmtp)) { + if (error && SCARG(uap, rmtp)) { error2 = copyout(&rmt, SCARG(uap, rmtp), sizeof(rmt)); if (error2) /* XXX shouldn't happen, did useracc() above */ return (error2); |