tty: Combine SIGTTOU/SIGTTIN handling
authorPeter Hurley <peter@hurleysoftware.com>
Sun, 11 Oct 2015 00:28:42 +0000 (20:28 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Oct 2015 04:30:49 +0000 (21:30 -0700)
commit2812d9e9fd94c54b0482215f579e6aa04452a322
tree04be4bb895b4bbde79538de1e61550fcae6d9dbe
parent71a5cd8a4a2602a6e9010b557a23af0a54df87b6
tty: Combine SIGTTOU/SIGTTIN handling

The job_control() check in n_tty_read() has nearly identical purpose
and results as tty_check_change(). Both functions' purpose is to
determine if the current task's pgrp is the foreground pgrp for the tty,
and if not, to signal the current pgrp.

Introduce __tty_check_change() which takes the signal to send
and performs the shared operations for job control() and
tty_check_change().

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c
drivers/tty/tty_io.c
include/linux/tty.h