summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-02-08 19:47:51 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-02-08 19:47:51 +0000
commit7b0d176b994510e63472ecaed7701cb0c0130f03 (patch)
tree6910718c23c0528ddad6b38a835caa624265f64d /sys
parentc13bd4bee4eb01ecb854f8f64e4e9fde788fb835 (diff)
require a FREFd fp in dofilereadv. Fix some comments.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/sys_generic.c9
-rw-r--r--sys/kern/vfs_syscalls.c16
2 files changed, 13 insertions, 12 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index c02c07b1eda..e1242ccae00 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_generic.c,v 1.34 2002/02/08 13:53:28 art Exp $ */
+/* $OpenBSD: sys_generic.c,v 1.35 2002/02/08 19:47:50 art Exp $ */
/* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */
/*
@@ -93,7 +93,7 @@ sys_read(p, v, retval)
FREF(fp);
- /* dofileread() will unuse the descriptor for us */
+ /* dofileread() will FRELE the descriptor for us */
return (dofileread(p, fd, fp, SCARG(uap, buf), SCARG(uap, nbyte),
&fp->f_offset, retval));
}
@@ -181,7 +181,9 @@ sys_readv(p, v, retval)
if ((fp->f_flag & FREAD) == 0)
return (EBADF);
- /* dofilereadv() will unuse the descriptor for us */
+ FREF(fp);
+
+ /* dofilereadv() will FRELE the descriptor for us */
return (dofilereadv(p, fd, fp, SCARG(uap, iovp), SCARG(uap, iovcnt),
&fp->f_offset, retval));
}
@@ -273,6 +275,7 @@ dofilereadv(p, fd, fp, iovp, iovcnt, offset, retval)
if (needfree)
free(needfree, M_IOV);
out:
+ FRELE(fp);
return (error);
}
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index b1da39d0335..0ee7ac2dbb7 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.90 2002/02/08 18:58:51 art Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.91 2002/02/08 19:47:50 art Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -2655,7 +2655,7 @@ sys_pread(p, v, retval)
FREF(fp);
- /* dofileread() will unuse the descriptor for us */
+ /* dofileread() will FRELE the descriptor for us */
return (dofileread(p, fd, fp, SCARG(uap, buf), SCARG(uap, nbyte),
&offset, retval));
}
@@ -2680,7 +2680,7 @@ sys_preadv(p, v, retval)
struct file *fp;
struct vnode *vp;
off_t offset;
- int error, fd = SCARG(uap, fd);
+ int fd = SCARG(uap, fd);
if ((fp = fd_getfile(fdp, fd)) == NULL)
return (EBADF);
@@ -2689,18 +2689,16 @@ sys_preadv(p, v, retval)
vp = (struct vnode *)fp->f_data;
if (fp->f_type != DTYPE_VNODE || vp->v_type == VFIFO) {
- error = ESPIPE;
- goto out;
+ return (ESPIPE);
}
+ FREF(fp);
+
offset = SCARG(uap, offset);
- /* dofilereadv() will unuse the descriptor for us */
+ /* dofilereadv() will FRELE the descriptor for us */
return (dofilereadv(p, fd, fp, SCARG(uap, iovp), SCARG(uap, iovcnt),
&offset, retval));
-
- out:
- return (error);
}
/*