diff options
author | dg <dg@FreeBSD.org> | 1994-08-18 03:53:38 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1994-08-18 03:53:38 +0000 |
commit | c87abe4536bb366a683e0f2b5fcaaa67d072ba75 (patch) | |
tree | 0bd9e4575ba17551135134914e0a66b75499cf4c | |
parent | bed5746ca6e21f902b652029c33f637f3ba45588 (diff) | |
download | FreeBSD-src-c87abe4536bb366a683e0f2b5fcaaa67d072ba75.zip FreeBSD-src-c87abe4536bb366a683e0f2b5fcaaa67d072ba75.tar.gz |
Moved over my fix for vnode lossage when multiple TIOCSCTTY ioctls are
done. This patch was extended to also include a suggested change by
Kirk McKusick which allows the control tty to be reasigned to a different
tty without losing a vnode.
-rw-r--r-- | sys/kern/vfs_vnops.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 2b64299..7229c33 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94 - * $Id$ + * $Id: vfs_vnops.c,v 1.3 1994/08/02 07:43:33 davidg Exp $ */ #include <sys/param.h> @@ -398,6 +398,15 @@ vn_ioctl(fp, com, data, p) case VBLK: error = VOP_IOCTL(vp, com, data, fp->f_flag, p->p_ucred, p); if (error == 0 && com == TIOCSCTTY) { + + /* Do nothing if reassigning same control tty */ + if (p->p_session->s_ttyvp == vp) + return (0); + + /* Get rid of reference to old control tty */ + if (p->p_session->s_ttyvp) + vrele(p->p_session->s_ttyvp); + p->p_session->s_ttyvp = vp; VREF(vp); } |