diff options
author | dillon <dillon@FreeBSD.org> | 1999-11-18 08:08:28 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 1999-11-18 08:08:28 +0000 |
commit | bd95a150acc1fc88cede6f39fc0807cdc57a1382 (patch) | |
tree | 496b225d0701c8b70b5158e0dcf01404715f17bd /sys/kern/kern_descrip.c | |
parent | e14811bf93dc5e7354cbe5ba576fc1500128464d (diff) | |
download | FreeBSD-src-bd95a150acc1fc88cede6f39fc0807cdc57a1382.zip FreeBSD-src-bd95a150acc1fc88cede6f39fc0807cdc57a1382.tar.gz |
Only bother converting the stat structure if we intend to return it,
when no error occurs.
PR: kern/14966
Reviewed by: dillon@freebsd.org
Submitted by: Kelly Yancey kbyanc@posi.net
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r-- | sys/kern/kern_descrip.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index a0daf53..a659aee8 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -541,9 +541,10 @@ ofstat(p, uap) (fp = fdp->fd_ofiles[uap->fd]) == NULL) return (EBADF); error = fo_stat(fp, &ub, p); - cvtstat(&ub, &oub); - if (error == 0) + if (error == 0) { + cvtstat(&ub, &oub); error = copyout((caddr_t)&oub, (caddr_t)uap->sb, sizeof (oub)); + } return (error); } #endif /* COMPAT_43 || COMPAT_SUNOS */ |