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:
parent
50c15101a9
commit
151f7a5d8a
@ -541,9 +541,10 @@ ofstat(p, uap)
|
||||
(fp = fdp->fd_ofiles[uap->fd]) == NULL)
|
||||
return (EBADF);
|
||||
error = fo_stat(fp, &ub, p);
|
||||
if (error == 0) {
|
||||
cvtstat(&ub, &oub);
|
||||
if (error == 0)
|
||||
error = copyout((caddr_t)&oub, (caddr_t)uap->sb, sizeof (oub));
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
#endif /* COMPAT_43 || COMPAT_SUNOS */
|
||||
|
Loading…
Reference in New Issue
Block a user