summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index f5b7d91..4b86857 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1639,8 +1639,8 @@ ttymodem(struct tty *tp, int flag)
!ISSET(tp->t_cflag, CLOCAL)) {
SET(tp->t_state, TS_ZOMBIE);
CLR(tp->t_state, TS_CONNECTED);
+ sx_slock(&proctree_lock); /* XXX: protect t_session */
if (tp->t_session) {
- sx_slock(&proctree_lock);
if (tp->t_session->s_leader) {
struct proc *p;
@@ -1649,8 +1649,8 @@ ttymodem(struct tty *tp, int flag)
psignal(p, SIGHUP);
PROC_UNLOCK(p);
}
- sx_sunlock(&proctree_lock);
}
+ sx_sunlock(&proctree_lock);
ttyflush(tp, FREAD | FWRITE);
return (0);
}
OpenPOWER on IntegriCloud