summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2016-01-22 20:41:56 +0000
committerdim <dim@FreeBSD.org>2016-01-22 20:41:56 +0000
commit7cf07624a0c8bc9de65a351f13206cea487afb48 (patch)
tree10bd7a9c1abe1f278df85958745a2a09074c1dda /sys/kern/kern_exit.c
parentf011e361d3e821edf47ec30d69116ed25a05b696 (diff)
parent66dd616ca8c4d3779be38f549e7e793674dbfd03 (diff)
downloadFreeBSD-src-7cf07624a0c8bc9de65a351f13206cea487afb48.zip
FreeBSD-src-7cf07624a0c8bc9de65a351f13206cea487afb48.tar.gz
Merge ^/head r294169 through r294598.
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c54
1 files changed, 1 insertions, 53 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index ee87e58..1cd9b62 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -189,7 +189,6 @@ exit1(struct thread *td, int rval, int signo)
{
struct proc *p, *nq, *q, *t;
struct thread *tdt;
- struct vnode *ttyvp = NULL;
mtx_assert(&Giant, MA_NOTOWNED);
KASSERT(rval == 0 || signo == 0, ("exit1 rv %d sig %d", rval, signo));
@@ -394,60 +393,9 @@ exit1(struct thread *td, int rval, int signo)
}
vmspace_exit(td);
-
- sx_xlock(&proctree_lock);
- if (SESS_LEADER(p)) {
- struct session *sp = p->p_session;
- struct tty *tp;
-
- /*
- * s_ttyp is not zero'd; we use this to indicate that
- * the session once had a controlling terminal. (for
- * logging and informational purposes)
- */
- SESS_LOCK(sp);
- ttyvp = sp->s_ttyvp;
- tp = sp->s_ttyp;
- sp->s_ttyvp = NULL;
- sp->s_ttydp = NULL;
- sp->s_leader = NULL;
- SESS_UNLOCK(sp);
-
- /*
- * Signal foreground pgrp and revoke access to
- * controlling terminal if it has not been revoked
- * already.
- *
- * Because the TTY may have been revoked in the mean
- * time and could already have a new session associated
- * with it, make sure we don't send a SIGHUP to a
- * foreground process group that does not belong to this
- * session.
- */
-
- if (tp != NULL) {
- tty_lock(tp);
- if (tp->t_session == sp)
- tty_signal_pgrp(tp, SIGHUP);
- tty_unlock(tp);
- }
-
- if (ttyvp != NULL) {
- sx_xunlock(&proctree_lock);
- if (vn_lock(ttyvp, LK_EXCLUSIVE) == 0) {
- VOP_REVOKE(ttyvp, REVOKEALL);
- VOP_UNLOCK(ttyvp, 0);
- }
- sx_xlock(&proctree_lock);
- }
- }
- fixjobc(p, p->p_pgrp, 0);
- sx_xunlock(&proctree_lock);
+ killjobc();
(void)acct_process(td);
- /* Release the TTY now we've unlocked everything. */
- if (ttyvp != NULL)
- vrele(ttyvp);
#ifdef KTRACE
ktrprocexit(td);
#endif
OpenPOWER on IntegriCloud