summaryrefslogtreecommitdiff
path: root/sys/compat/osf1/osf1_descrip.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-10-26 12:03:29 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-10-26 12:03:29 +0000
commiteb46b9853439c27012a22a86f3d9139930a9e87a (patch)
tree0668f2d444b8c90d902fc4d94aaf484b512bab93 /sys/compat/osf1/osf1_descrip.c
parent322ae2c6b01056eccf34722ee78713e1b3337123 (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/compat/osf1/osf1_descrip.c')
-rw-r--r--sys/compat/osf1/osf1_descrip.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/compat/osf1/osf1_descrip.c b/sys/compat/osf1/osf1_descrip.c
index 784f4ec7511..ea2b3ae3839 100644
--- a/sys/compat/osf1/osf1_descrip.c
+++ b/sys/compat/osf1/osf1_descrip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: osf1_descrip.c,v 1.6 2001/05/14 13:28:23 art Exp $ */
+/* $OpenBSD: osf1_descrip.c,v 1.7 2001/10/26 12:03:27 art Exp $ */
/* $NetBSD: osf1_descrip.c,v 1.5 1999/06/26 01:24:41 cgd Exp $ */
/*
@@ -243,10 +243,7 @@ osf1_sys_fstat(p, v, retval)
struct osf1_stat oub;
int error;
- /* XXX */
- if ((unsigned)SCARG(uap, fd) >= fdp->fd_nfiles ||
- (fp = fdp->fd_ofiles[SCARG(uap, fd)]) == NULL) /* ||
- (fp->f_iflags & FIF_WANTCLOSE) != 0) */
+ if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL)
return (EBADF);
error = (*fp->f_ops->fo_stat)(fp, &ub, p);