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
This commit is contained in:
Matthew Dillon 1999-11-18 08:08:28 +00:00
parent 50c15101a9
commit 151f7a5d8a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=53347

View File

@ -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 */