diff options
Diffstat (limited to 'sys/compat/svr4')
-rw-r--r-- | sys/compat/svr4/svr4_fcntl.c | 4 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_ioctl.c | 5 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_net.c | 3 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_stream.c | 14 |
4 files changed, 11 insertions, 15 deletions
diff --git a/sys/compat/svr4/svr4_fcntl.c b/sys/compat/svr4/svr4_fcntl.c index 98fba9d611a..a859b7af903 100644 --- a/sys/compat/svr4/svr4_fcntl.c +++ b/sys/compat/svr4/svr4_fcntl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_fcntl.c,v 1.18 2001/03/25 05:20:01 csapuntz Exp $ */ +/* $OpenBSD: svr4_fcntl.c,v 1.19 2001/10/26 12:03:27 art Exp $ */ /* $NetBSD: svr4_fcntl.c,v 1.14 1995/10/14 20:24:24 christos Exp $ */ /* @@ -265,7 +265,7 @@ fd_truncate(p, fd, flp, retval) /* * We only support truncating the file. */ - if ((u_int)fd >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[fd]) == NULL) + if ((fp = fd_getfile(fdp, fd)) == NULL) return EBADF; vp = (struct vnode *)fp->f_data; diff --git a/sys/compat/svr4/svr4_ioctl.c b/sys/compat/svr4/svr4_ioctl.c index 6bda9363f4a..f70b03d6f36 100644 --- a/sys/compat/svr4/svr4_ioctl.c +++ b/sys/compat/svr4/svr4_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_ioctl.c,v 1.8 2000/08/29 02:22:13 brad Exp $ */ +/* $OpenBSD: svr4_ioctl.c,v 1.9 2001/10/26 12:03:27 art Exp $ */ /* $NetBSD: svr4_ioctl.c,v 1.16 1996/04/11 12:54:41 christos Exp $ */ /* @@ -109,8 +109,7 @@ svr4_sys_ioctl(p, v, retval) fdp = p->p_fd; cmd = SCARG(uap, com); - 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; if ((fp->f_flag & (FREAD | FWRITE)) == 0) diff --git a/sys/compat/svr4/svr4_net.c b/sys/compat/svr4/svr4_net.c index 9ba6c01a0ca..3c04d31004d 100644 --- a/sys/compat/svr4/svr4_net.c +++ b/sys/compat/svr4/svr4_net.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_net.c,v 1.11 2001/05/14 12:38:48 art Exp $ */ +/* $OpenBSD: svr4_net.c,v 1.12 2001/10/26 12:03:27 art Exp $ */ /* $NetBSD: svr4_net.c,v 1.12 1996/09/07 12:40:51 mycroft Exp $ */ /* @@ -187,6 +187,7 @@ svr4_netopen(dev, flag, mode, p) DPRINTF(("ok);\n")); p->p_dupfd = fd; + FILE_SET_MATURE(fp); return ENXIO; } diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c index 5b20c9d5d9e..fce64e4a0c1 100644 --- a/sys/compat/svr4/svr4_stream.c +++ b/sys/compat/svr4/svr4_stream.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_stream.c,v 1.13 2001/10/02 17:40:20 csapuntz Exp $ */ +/* $OpenBSD: svr4_stream.c,v 1.14 2001/10/26 12:03:27 art Exp $ */ /* $NetBSD: svr4_stream.c,v 1.19 1996/12/22 23:00:03 fvdl Exp $ */ /* @@ -1421,8 +1421,7 @@ svr4_sys_putmsg(p, v, retval) int error; caddr_t sg; - 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; #ifdef DEBUG_SVR4 @@ -1430,8 +1429,7 @@ svr4_sys_putmsg(p, v, retval) SCARG(uap, dat), SCARG(uap, flags)); #endif /* DEBUG_SVR4 */ - 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; if (SCARG(uap, ctl) != NULL) { @@ -1572,8 +1570,7 @@ svr4_sys_getmsg(p, v, retval) int fl; caddr_t sg; - 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; bzero(&sc, sizeof(sc)); @@ -1583,8 +1580,7 @@ svr4_sys_getmsg(p, v, retval) SCARG(uap, dat), 0); #endif /* DEBUG_SVR4 */ - 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; if (SCARG(uap, ctl) != NULL) { |