tty: Signal foreground group processes in hangup
authorPeter Hurley <peter@hurleysoftware.com>
Wed, 6 Mar 2013 12:20:56 +0000 (07:20 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Mar 2013 21:02:32 +0000 (14:02 -0700)
commitf91e2590410bd992e3f065d17c55329bdaa51b1d
tree9f815911a08f725c05c5f30c83e60d900fb1ba9a
parentbc30c3b23bb953fc6eb59e7ac6ecb48d92962bb0
tty: Signal foreground group processes in hangup

When the session leader is exiting, signal the foreground group
processes as part of the hangup sequence, instead of after the
hangup is complete. This prepares for hanging up the
line discipline _after_ signalling processes which
may be blocking on ldisc i/o.

Parameterize __tty_hangup() to distinguish between when the
session leader is exiting and all other hangups; signal the
foreground group after signalling the session leader and its
process group, which preserves the original signal order.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Acked-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_io.c