summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-03-07 03:37:06 +0000
committerjhb <jhb@FreeBSD.org>2001-03-07 03:37:06 +0000
commit9cd254601baefc2dc9c953abe9747717374ff8b1 (patch)
treeac4298224e8af28e8b2f904a43a2925c21dfc798 /sys/kern/tty.c
parentace71d59bf35fa6d911520ec855d0100773422a8 (diff)
downloadFreeBSD-src-9cd254601baefc2dc9c953abe9747717374ff8b1.zip
FreeBSD-src-9cd254601baefc2dc9c953abe9747717374ff8b1.tar.gz
Grab the process lock while calling psignal and before calling psignal.
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index a7ba12d..d57135d 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1467,8 +1467,14 @@ ttymodem(tp, flag)
!ISSET(tp->t_cflag, CLOCAL)) {
SET(tp->t_state, TS_ZOMBIE);
CLR(tp->t_state, TS_CONNECTED);
- if (tp->t_session && tp->t_session->s_leader)
- psignal(tp->t_session->s_leader, SIGHUP);
+ if (tp->t_session && tp->t_session->s_leader) {
+ struct proc *p;
+
+ p = tp->t_session->s_leader;
+ PROC_LOCK(p);
+ psignal(p, SIGHUP);
+ PROC_UNLOCK(p);
+ }
ttyflush(tp, FREAD | FWRITE);
return (0);
}
OpenPOWER on IntegriCloud