diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-08-23 15:39:32 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-08-23 15:39:32 +0000 |
commit | 0037f572cfa2fac5d4856ab2774b5d879e46d2c0 (patch) | |
tree | bc73652b01ced4a34b60e13f5c0fcebf6c03654d /sys/compat/common/vfs_syscalls_43.c | |
parent | 557b435e5b58e8c4514957fceb7d44dc55877d99 (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/common/vfs_syscalls_43.c')
-rw-r--r-- | sys/compat/common/vfs_syscalls_43.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/compat/common/vfs_syscalls_43.c b/sys/compat/common/vfs_syscalls_43.c index cf9a4b229a3..1e6d437229b 100644 --- a/sys/compat/common/vfs_syscalls_43.c +++ b/sys/compat/common/vfs_syscalls_43.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls_43.c,v 1.19 2002/03/14 01:26:49 millert Exp $ */ +/* $OpenBSD: vfs_syscalls_43.c,v 1.20 2002/08/23 15:39:31 art Exp $ */ /* $NetBSD: vfs_syscalls_43.c,v 1.4 1996/03/14 19:31:52 christos Exp $ */ /* @@ -355,9 +355,10 @@ compat_43_sys_getdirentries(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; + } vp = (struct vnode *)fp->f_data; unionread: if (vp->v_type != VDIR) { |