diff options
| author | 2001-10-26 12:03:27 +0000 | |
|---|---|---|
| committer | 2001-10-26 12:03:27 +0000 | |
| commit | af97e5cfdd9f3b11ddf6b53127c6fa8808c13864 (patch) | |
| tree | 196c0184f49baa99376ee4bc29405db139ede540 /sys/compat/linux/linux_hdio.c | |
| parent | Well, "zap kernfs" and MISS! (diff) | |
| download | wireguard-openbsd-af97e5cfdd9f3b11ddf6b53127c6fa8808c13864.tar.xz wireguard-openbsd-af97e5cfdd9f3b11ddf6b53127c6fa8808c13864.zip | |
- 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/linux/linux_hdio.c')
| -rw-r--r-- | sys/compat/linux/linux_hdio.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/sys/compat/linux/linux_hdio.c b/sys/compat/linux/linux_hdio.c index 1e4c6c03d3a..bcc3ac62298 100644 --- a/sys/compat/linux/linux_hdio.c +++ b/sys/compat/linux/linux_hdio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_hdio.c,v 1.1 2001/04/09 06:53:45 tholo Exp $ */ +/* $OpenBSD: linux_hdio.c,v 1.2 2001/10/26 12:03:27 art Exp $ */ /* $NetBSD: linux_hdio.c,v 1.1 2000/12/10 14:12:17 fvdl Exp $ */ /* @@ -77,18 +77,8 @@ linux_ioctl_hdio(struct proc *p, struct linux_sys_ioctl_args *uap, struct linux_hd_big_geometry hdg_big; fdp = p->p_fd; -#if 1 - if ((u_int)SCARG(uap, fd) >= fdp->fd_nfiles || - (fp = fdp->fd_ofiles[SCARG(uap, fd)]) == NULL) + if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL) return (EBADF); -#else - if ((u_int)SCARG(uap, fd) >= fdp->fd_nfiles || - (fp = fdp->fd_ofiles[SCARG(uap, fd)]) == NULL || - (fp->f_iflags & FIF_WANTCLOSE) != 0) - return (EBADF); - - FILE_USE(fp); -#endif com = SCARG(uap, com); ioctlf = fp->f_ops->fo_ioctl; |
