diff options
author | Mark Brown <broonie@kernel.org> | 2015-02-02 11:29:20 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-02-02 11:29:20 +0000 |
commit | a779989fd4ccf6a58237ab3932559d8e60e157b6 (patch) | |
tree | ea759860928a468bc7be80288014b9d739753718 /drivers/tty | |
parent | 9347e87f7cd66d6ca96ba7d0b4b1cacebea4d096 (diff) | |
parent | 016ea480c9ca2344006d3ef592a0154ba03b507a (diff) |
Merge tag 'v3.14.31' into linux-linaro-lsk-v3.14
This is the 3.14.31 stable release
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/n_tty.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index d46b4ccec8cd..850e232d086e 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -2417,12 +2417,17 @@ static unsigned int n_tty_poll(struct tty_struct *tty, struct file *file, poll_wait(file, &tty->read_wait, wait); poll_wait(file, &tty->write_wait, wait); + if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) + mask |= POLLHUP; if (input_available_p(tty, 1)) mask |= POLLIN | POLLRDNORM; + else if (mask & POLLHUP) { + tty_flush_to_ldisc(tty); + if (input_available_p(tty, 1)) + mask |= POLLIN | POLLRDNORM; + } if (tty->packet && tty->link->ctrl_status) mask |= POLLPRI | POLLIN | POLLRDNORM; - if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) - mask |= POLLHUP; if (tty_hung_up_p(file)) mask |= POLLHUP; if (!(mask & (POLLHUP | POLLIN | POLLRDNORM))) { |