Skip to content

Commit fe812e6

Browse files
oleg-nesterovgregkh
authored andcommitted
tty: disassociate_ctty() sends the extra SIGCONT
commit 03e1261 upstream. 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" 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7af69d3 commit fe812e6

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
@@ -850,7 +850,8 @@ void disassociate_ctty(int on_exit)
850850
struct pid *tty_pgrp = tty_get_pgrp(tty);
851851
if (tty_pgrp) {
852852
kill_pgrp(tty_pgrp, SIGHUP, on_exit);
853-
kill_pgrp(tty_pgrp, SIGCONT, on_exit);
853+
if (!on_exit)
854+
kill_pgrp(tty_pgrp, SIGCONT, on_exit);
854855
put_pid(tty_pgrp);
855856
}
856857
}

0 commit comments

Comments
 (0)