diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-02-02 16:05:59 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-02-02 16:05:59 +0000 |
commit | 1be6a40a464e4e44fb84b7d1fa048a217bbdeece (patch) | |
tree | 7e6c611fd09febf362436ee21ca66f3e3ab1fcaf /sys/compat/sunos | |
parent | 5bdfd47e797e6f77a7f3809b3f0552d0218a364b (diff) |
Be more consistent about using fd_getfile where it matters.
Diffstat (limited to 'sys/compat/sunos')
-rw-r--r-- | sys/compat/sunos/sunos_misc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/compat/sunos/sunos_misc.c b/sys/compat/sunos/sunos_misc.c index 6e92dd5c68b..685803ead25 100644 --- a/sys/compat/sunos/sunos_misc.c +++ b/sys/compat/sunos/sunos_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sunos_misc.c,v 1.30 2001/11/06 19:53:17 miod Exp $ */ +/* $OpenBSD: sunos_misc.c,v 1.31 2002/02/02 16:05:58 art Exp $ */ /* $NetBSD: sunos_misc.c,v 1.65 1996/04/22 01:44:31 christos Exp $ */ /* @@ -685,8 +685,10 @@ sunos_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; + if ((fp = fd_getfile(fdp, *retval)) == NULL) + return (EBADF); /* ignore any error, just give it a try */ if (fp->f_type == DTYPE_VNODE) (fp->f_ops->fo_ioctl)(fp, TIOCSCTTY, (caddr_t)0, p); |