summaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_file.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-02-02 16:05:59 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-02-02 16:05:59 +0000
commit1be6a40a464e4e44fb84b7d1fa048a217bbdeece (patch)
tree7e6c611fd09febf362436ee21ca66f3e3ab1fcaf /sys/compat/linux/linux_file.c
parent5bdfd47e797e6f77a7f3809b3f0552d0218a364b (diff)
Be more consistent about using fd_getfile where it matters.
Diffstat (limited to 'sys/compat/linux/linux_file.c')
-rw-r--r--sys/compat/linux/linux_file.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index c7e1ba769cc..9b2e3b49e8e 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_file.c,v 1.18 2001/10/26 12:03:27 art Exp $ */
+/* $OpenBSD: linux_file.c,v 1.19 2002/02/02 16:05:58 art Exp $ */
/* $NetBSD: linux_file.c,v 1.15 1996/05/20 01:59:09 fvdl Exp $ */
/*
@@ -192,9 +192,10 @@ linux_sys_open(p, v, retval)
*/
if (!(fl & O_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);
}