summaryrefslogtreecommitdiff
path: root/sys/compat/netbsd
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-08-23 15:39:32 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-08-23 15:39:32 +0000
commit0037f572cfa2fac5d4856ab2774b5d879e46d2c0 (patch)
treebc73652b01ced4a34b60e13f5c0fcebf6c03654d /sys/compat/netbsd
parent557b435e5b58e8c4514957fceb7d44dc55877d99 (diff)
Cleanup change. Since almost all callers (except one) of getvnode did a FREF
on the returned file, do the FREF inside getvnode so that people can't get away with avoiding FREF and FRELE. Eyeballed by various people.
Diffstat (limited to 'sys/compat/netbsd')
-rw-r--r--sys/compat/netbsd/netbsd_file.c3
-rw-r--r--sys/compat/netbsd/netbsd_getdents.c10
2 files changed, 7 insertions, 6 deletions
diff --git a/sys/compat/netbsd/netbsd_file.c b/sys/compat/netbsd/netbsd_file.c
index 65f6f7c77bf..fc1268bbc87 100644
--- a/sys/compat/netbsd/netbsd_file.c
+++ b/sys/compat/netbsd/netbsd_file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netbsd_file.c,v 1.3 2002/03/14 01:26:50 millert Exp $ */
+/* $OpenBSD: netbsd_file.c,v 1.4 2002/08/23 15:39:31 art Exp $ */
/* $NetBSD: freebsd_file.c,v 1.3 1996/05/03 17:03:09 christos Exp $ */
/*
@@ -597,7 +597,6 @@ netbsd_sys_fstatfs(p, v, retval)
return (error);
mp = ((struct vnode *)fp->f_data)->v_mount;
sp = &mp->mnt_stat;
- FREF(fp);
error = VFS_STATFS(mp, sp, p);
FRELE(fp);
if (error)
diff --git a/sys/compat/netbsd/netbsd_getdents.c b/sys/compat/netbsd/netbsd_getdents.c
index 50d89dfd5ff..9b735ca5aee 100644
--- a/sys/compat/netbsd/netbsd_getdents.c
+++ b/sys/compat/netbsd/netbsd_getdents.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netbsd_getdents.c,v 1.6 2002/03/14 01:26:50 millert Exp $ */
+/* $OpenBSD: netbsd_getdents.c,v 1.7 2002/08/23 15:39:31 art Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@@ -165,12 +165,14 @@ netbsd_sys_getdents(p, v, retval)
if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
- if ((fp->f_flag & FREAD) == 0)
- return (EBADF);
- FREF(fp);
+ if ((fp->f_flag & FREAD) == 0) {
+ error = EBADF;
+ goto bad;
+ }
error = netbsd_vn_readdir(fp, SCARG(uap, buf), UIO_USERSPACE,
SCARG(uap, count), &done, p, 0, 0);
*retval = done;
+bad:
FRELE(fp);
return (error);
}