mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 19:08:58 +00:00
Use fo_stat() rather than Yet Another duplication of kern_descrip.c's stat
code.
This commit is contained in:
parent
b127fae405
commit
53c2c4e22b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=52986
@ -175,21 +175,7 @@ linux_newfstat(struct proc *p, struct linux_newfstat_args *args)
|
||||
(fp = fdp->fd_ofiles[args->fd]) == NULL)
|
||||
return (EBADF);
|
||||
|
||||
switch (fp->f_type) {
|
||||
case DTYPE_FIFO:
|
||||
case DTYPE_VNODE:
|
||||
error = vn_stat((struct vnode *)fp->f_data, &buf, p);
|
||||
break;
|
||||
case DTYPE_SOCKET:
|
||||
error = soo_stat((struct socket *)fp->f_data, &buf);
|
||||
break;
|
||||
case DTYPE_PIPE:
|
||||
error = pipe_stat((struct pipe *)fp->f_data, &buf);
|
||||
break;
|
||||
default:
|
||||
panic("LINUX newfstat");
|
||||
}
|
||||
|
||||
error = fo_stat(fp, &buf, p);
|
||||
if (!error)
|
||||
error = newstat_copyout(&buf, args->buf);
|
||||
|
||||
|
@ -175,21 +175,7 @@ linux_newfstat(struct proc *p, struct linux_newfstat_args *args)
|
||||
(fp = fdp->fd_ofiles[args->fd]) == NULL)
|
||||
return (EBADF);
|
||||
|
||||
switch (fp->f_type) {
|
||||
case DTYPE_FIFO:
|
||||
case DTYPE_VNODE:
|
||||
error = vn_stat((struct vnode *)fp->f_data, &buf, p);
|
||||
break;
|
||||
case DTYPE_SOCKET:
|
||||
error = soo_stat((struct socket *)fp->f_data, &buf);
|
||||
break;
|
||||
case DTYPE_PIPE:
|
||||
error = pipe_stat((struct pipe *)fp->f_data, &buf);
|
||||
break;
|
||||
default:
|
||||
panic("LINUX newfstat");
|
||||
}
|
||||
|
||||
error = fo_stat(fp, &buf, p);
|
||||
if (!error)
|
||||
error = newstat_copyout(&buf, args->buf);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user