diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-02-08 18:58:52 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-02-08 18:58:52 +0000 |
commit | ac5f7368cdbac18d0f79c9b6bc9cdecd926e36ba (patch) | |
tree | 9389e85ff2e738f96b2a39ebbf59b06e9de2d661 /sys | |
parent | 06c1991064763f20b4572a7f41063af21db661c8 (diff) |
simplify sys_pread a bit.
Diffstat (limited to 'sys')
-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)); |