summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-02-08 18:58:52 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-02-08 18:58:52 +0000
commitac5f7368cdbac18d0f79c9b6bc9cdecd926e36ba (patch)
tree9389e85ff2e738f96b2a39ebbf59b06e9de2d661 /sys
parent06c1991064763f20b4572a7f41063af21db661c8 (diff)
simplify sys_pread a bit.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_syscalls.c7
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));