Skip to content

Commit 03e1261

Browse files
oleg-nesterovtorvalds
authored andcommitted
tty: disassociate_ctty() sends the extra SIGCONT
Starting from v3.10 (probably commit f91e259: "tty: Signal foreground group processes in hangup") disassociate_ctty() sends SIGCONT if tty && on_exit. This breaks LSB test-suite, in particular test8 in _exit.c and test40 in sigcon5.c. Put the "!on_exit" check back to restore the old behaviour. Review by Peter Hurley: "Yes, this regression was introduced by me in that commit. The effect of the regression is that ptys will receive a SIGCONT when, in similar circumstances, ttys would not. The fact that two test vectors accidentally tripped over this regression suggests that some other apps may as well. Thanks for catching this" Cc: [email protected] # v3.10+ Signed-off-by: Oleg Nesterov <[email protected]> Reported-by: Karel Srot <[email protected]> Reviewed-by: Peter Hurley <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent de0bc3d commit 03e1261

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/tty/tty_io.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,8 @@ void disassociate_ctty(int on_exit)
854854
struct pid *tty_pgrp = tty_get_pgrp(tty);
855855
if (tty_pgrp) {
856856
kill_pgrp(tty_pgrp, SIGHUP, on_exit);
857-
kill_pgrp(tty_pgrp, SIGCONT, on_exit);
857+
if (!on_exit)
858+
kill_pgrp(tty_pgrp, SIGCONT, on_exit);
858859
put_pid(tty_pgrp);
859860
}
860861
}

0 commit comments

Comments
 (0)