summaryrefslogtreecommitdiff
path: root/sys/compat/ibcs2/ibcs2_fcntl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/ibcs2/ibcs2_fcntl.c')
-rw-r--r--sys/compat/ibcs2/ibcs2_fcntl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/compat/ibcs2/ibcs2_fcntl.c b/sys/compat/ibcs2/ibcs2_fcntl.c
index 3352d62a7fe..dcdb6d1bdad 100644
--- a/sys/compat/ibcs2/ibcs2_fcntl.c
+++ b/sys/compat/ibcs2/ibcs2_fcntl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ibcs2_fcntl.c,v 1.6 2000/04/21 15:50:22 millert Exp $ */
+/* $OpenBSD: ibcs2_fcntl.c,v 1.7 2002/02/02 16:05:58 art Exp $ */
/* $NetBSD: ibcs2_fcntl.c,v 1.6 1996/05/03 17:05:20 christos Exp $ */
/*
@@ -185,9 +185,10 @@ ibcs2_sys_open(p, v, retval)
if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) {
struct filedesc *fdp = p->p_fd;
- struct file *fp = fdp->fd_ofiles[*retval];
+ struct file *fp;
- /* ignore any error, just give it a try */
+ if ((fp = fd_getfile(fdp, *retval)) == NULL)
+ return EBADF;
if (fp->f_type == DTYPE_VNODE)
(fp->f_ops->fo_ioctl)(fp, TIOCSCTTY, (caddr_t) 0, p);
}