summaryrefslogtreecommitdiff
path: root/sys/compat/sunos/sunos_misc.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/sunos/sunos_misc.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/sunos/sunos_misc.c')
-rw-r--r--sys/compat/sunos/sunos_misc.c7
1 files changed, 4 insertions, 3 deletions
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*/