diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-06-15 19:17:52 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-15 19:17:52 +0000 |
commit | 9c373a81a380a40c338398568ef2eab677d8bc00 (patch) | |
tree | fa0fa19b7b868432e961c6655510a999e74566d3 /sys/kern/kern_exit.c | |
parent | 9ed47d01eb935541b9cafd369eb653c35cce7067 (diff) | |
download | src-9c373a81a380a40c338398568ef2eab677d8bc00.tar.gz src-9c373a81a380a40c338398568ef2eab677d8bc00.zip |
Make tcsetsid(3) work on revoked TTYs.
Right now the only way to make tcsetsid(3)/TIOCSCTTY work, is by
ensuring the session leader is dead. This means that an application that
catches SIGHUPs and performs a sleep prevents us from assigning a new
session leader.
Change the code to make it work on revoked TTYs as well. This allows us
to change init(8) to make the shutdown script run in a more clean
environment.
Notes
Notes:
svn path=/head/; revision=194256
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r-- | sys/kern/kern_exit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 37d025480efd..673707f7387f 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -309,7 +309,7 @@ exit1(struct thread *td, int rv) sp->s_ttyvp = NULL; SESS_UNLOCK(sp); - if (ttyvp != NULL) { + if (ttyvp != NULL && ttyvp->v_type != VBAD) { /* * Controlling process. * Signal foreground pgrp and revoke access to |