diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-10-26 12:03:29 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-10-26 12:03:29 +0000 |
commit | eb46b9853439c27012a22a86f3d9139930a9e87a (patch) | |
tree | 0668f2d444b8c90d902fc4d94aaf484b512bab93 /sys/miscfs/fdesc/fdesc_vnops.c | |
parent | 322ae2c6b01056eccf34722ee78713e1b3337123 (diff) |
- every new fd created by falloc() is marked as larval and should not be used
any anyone. Every caller of falloc matures the fd when it's usable.
- Since every lookup in the fd table must now check this flag and all of
them do the same thing, move all the necessary checks into a function -
fd_getfile.
Diffstat (limited to 'sys/miscfs/fdesc/fdesc_vnops.c')
-rw-r--r-- | sys/miscfs/fdesc/fdesc_vnops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/miscfs/fdesc/fdesc_vnops.c b/sys/miscfs/fdesc/fdesc_vnops.c index 69655c6f34d..1fb61c30ae1 100644 --- a/sys/miscfs/fdesc/fdesc_vnops.c +++ b/sys/miscfs/fdesc/fdesc_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fdesc_vnops.c,v 1.23 2001/06/23 02:14:24 csapuntz Exp $ */ +/* $OpenBSD: fdesc_vnops.c,v 1.24 2001/10/26 12:03:28 art Exp $ */ /* $NetBSD: fdesc_vnops.c,v 1.32 1996/04/11 11:24:29 mrg Exp $ */ /* @@ -480,7 +480,7 @@ fdesc_getattr(v) case Fdesc: fd = VTOFDESC(vp)->fd_fd; fdp = ap->a_p->p_fd; - if (fd >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[fd]) == NULL) + if ((fp = fd_getfile(fdp, fd)) == NULL) return (EBADF); memset(&stb, 0, sizeof(stb)); error = (*fp->f_ops->fo_stat)(fp, &stb, ap->a_p); |