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/compat/ultrix/ultrix_misc.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/compat/ultrix/ultrix_misc.c')
-rw-r--r-- | sys/compat/ultrix/ultrix_misc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/compat/ultrix/ultrix_misc.c b/sys/compat/ultrix/ultrix_misc.c index de70e550b4c..c17a4ffb185 100644 --- a/sys/compat/ultrix/ultrix_misc.c +++ b/sys/compat/ultrix/ultrix_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ultrix_misc.c,v 1.19 2001/07/27 21:29:53 miod Exp $ */ +/* $OpenBSD: ultrix_misc.c,v 1.20 2001/10/26 12:03:27 art Exp $ */ /* $NetBSD: ultrix_misc.c,v 1.23 1996/04/07 17:23:04 jonathan Exp $ */ /* @@ -344,8 +344,7 @@ ultrix_sys_mmap(p, v, retval) * Special case: if fd refers to /dev/zero, map as MAP_ANON. (XXX) */ 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*/ |