signals: SIGCONT should be sent after a SIGHUP
authorAlan Cox <alan@linux.intel.com>
Tue, 29 Dec 2015 22:43:14 +0000 (22:43 +0000)
committerAlan Cox <alan@linux.intel.com>
Tue, 29 Dec 2015 22:43:14 +0000 (22:43 +0000)
Kernel/process.c
Kernel/tty.c

index 989a3c1..b4f8d45 100644 (file)
@@ -427,9 +427,10 @@ void unix_syscall(void)
 void sgrpsig(uint16_t pgrp, uint16_t sig)
 {
        ptptr p;
-       for (p = ptab; p < ptab_end; ++p) {
-               if (p->p_pgrp == pgrp)
-                       ssig(p, sig);
+       if (pgrp) {
+               for (p = ptab; p < ptab_end; ++p)
+                       if (p->p_pgrp == pgrp)
+                               ssig(p, sig);
        }
 }
 
@@ -607,6 +608,7 @@ void doexit(int16_t val, int16_t val2)
                 if (p->p_pgrp == udata.u_ptab->p_pid) {
                        p->p_pgrp = 0;
                        ssig(p, SIGHUP);
+                       ssig(p, SIGCONT);
                }
        }
        tty_exit();
index 4dc6833..c9ce5ff 100644 (file)
@@ -445,6 +445,7 @@ void tty_hangup(uint8_t minor)
         struct tty *t = &ttydata[minor];
         /* Kill users */
         sgrpsig(t->pgrp, SIGHUP);
+        sgrpsig(t->pgrp, SIGCONT);
         t->pgrp = 0;
         /* Stop any new I/O with errors */
         t->flag |= TTYF_DEAD;