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/sunos/sunos_misc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/compat/sunos/sunos_misc.c') diff --git a/sys/compat/sunos/sunos_misc.c b/sys/compat/sunos/sunos_misc.c index b05b8204979..bf09360cb49 100644 --- a/sys/compat/sunos/sunos_misc.c +++ b/sys/compat/sunos/sunos_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sunos_misc.c,v 1.27 2001/05/16 12:50:20 ho Exp $ */ +/* $OpenBSD: sunos_misc.c,v 1.28 2001/10/26 12:03:27 art Exp $ */ /* $NetBSD: sunos_misc.c,v 1.65 1996/04/22 01:44:31 christos Exp $ */ /* @@ -490,10 +490,11 @@ sunos_sys_mmap(p, v, retval) /* * Special case: if fd refers to /dev/zero, map as MAP_ANON. (XXX) + * XXXART - this is probably completly unnecessary. mmap deals with + * XXXART - this just fine. */ fdp = p->p_fd; - if ((unsigned)SCARG(&ouap, fd) < fdp->fd_nfiles && /*XXX*/ - (fp = fdp->fd_ofiles[SCARG(&ouap, fd)]) != NULL && /*XXX*/ + if ((fp = fd_getfile(fdp, SCARG(&ouap, fd))) != NULL && /*XXX*/ fp->f_type == DTYPE_VNODE && /*XXX*/ (vp = (struct vnode *)fp->f_data)->v_type == VCHR && /*XXX*/ iszerodev(vp->v_rdev)) { /*XXX*/ -- cgit v1.2.3