diff options
-rw-r--r-- | sys/kern/vfs_syscalls.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index f60e590b6ae..b1da39d0335 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.89 2002/02/08 13:53:28 art Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.90 2002/02/08 18:58:51 art Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -2646,16 +2646,15 @@ sys_pread(p, v, retval) if ((fp->f_flag & FREAD) == 0) return (EBADF); - FREF(fp); - vp = (struct vnode *)fp->f_data; if (fp->f_type != DTYPE_VNODE || vp->v_type == VFIFO) { - FRELE(fp); return (ESPIPE); } offset = SCARG(uap, offset); + FREF(fp); + /* dofileread() will unuse the descriptor for us */ return (dofileread(p, fd, fp, SCARG(uap, buf), SCARG(uap, nbyte), &offset, retval)); |