From eb46b9853439c27012a22a86f3d9139930a9e87a Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Fri, 26 Oct 2001 12:03:29 +0000 Subject: - 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. --- sys/compat/common/vfs_syscalls_43.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sys/compat/common/vfs_syscalls_43.c') diff --git a/sys/compat/common/vfs_syscalls_43.c b/sys/compat/common/vfs_syscalls_43.c index 91e03cf4076..0edb4c3a51f 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.14 2001/05/14 13:28:22 art Exp $ */ +/* $OpenBSD: vfs_syscalls_43.c,v 1.15 2001/10/26 12:03:27 art Exp $ */ /* $NetBSD: vfs_syscalls_43.c,v 1.4 1996/03/14 19:31:52 christos Exp $ */ /* @@ -196,8 +196,7 @@ compat_43_sys_fstat(p, v, retval) struct ostat oub; int error; - if ((u_int)fd >= fdp->fd_nfiles || - (fp = fdp->fd_ofiles[fd]) == NULL) + if ((fp = fd_getfile(fdp, fd)) == NULL) return (EBADF); error = (*fp->f_ops->fo_stat)(fp, &ub, p); cvtstat(&ub, &oub); -- cgit v1.2.3