aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_stats.c
diff options
context:
space:
mode:
authorDoug Ambrisko <ambrisko@FreeBSD.org>2006-05-16 17:57:00 +0000
committerDoug Ambrisko <ambrisko@FreeBSD.org>2006-05-16 17:57:00 +0000
commitedb75eca277dcb4272a0054e92592f65441f7cdb (patch)
treecf9be2d7c4f63ffae278c4f8e0a25a6c03a7bf3c /sys/compat/linux/linux_stats.c
parentba9dfb8097261eccbd2b530dc7f3398b0f235009 (diff)
Notes
Diffstat (limited to 'sys/compat/linux/linux_stats.c')
-rw-r--r--sys/compat/linux/linux_stats.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c
index d35377c9e167..f19019a3fc0f 100644
--- a/sys/compat/linux/linux_stats.c
+++ b/sys/compat/linux/linux_stats.c
@@ -122,6 +122,8 @@ translate_fd_major_minor(struct thread *td, int fd, struct stat *buf)
static void
translate_path_major_minor(struct thread *td, char *path, struct stat *buf)
{
+ struct proc *p = td->td_proc;
+ struct filedesc *fdp = p->p_fd;
struct file *fp;
int fd;
int temp;
@@ -132,8 +134,10 @@ translate_path_major_minor(struct thread *td, char *path, struct stat *buf)
fd = td->td_retval[0];
td->td_retval[0] = temp;
translate_fd_major_minor(td, fd, buf);
- fget(td, fd, &fp);
- closef(fp, td);
+ FILEDESC_LOCK(fdp);
+ fp = fdp->fd_ofiles[fd];
+ FILEDESC_UNLOCK(fdp);
+ fdclose(fdp, fdp->fd_ofiles[fd], fd, td);
}
static int