diff options
author | Alex Shi <alex.shi@linaro.org> | 2015-03-19 08:57:04 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2015-03-19 08:57:04 +0800 |
commit | ba0bfedf4c9cad58f56a7038d1462ffc21cd33df (patch) | |
tree | bc5582403ad15b835d1b69b2ab81bda44292f3e3 /drivers/tty/tty_ioctl.c | |
parent | 43e7406efd7822d75c64310461d2cbca0ece19f0 (diff) | |
parent | 7f4e64246049cef5ae1eca37eec1701a9477799e (diff) |
Merge tag 'v3.10.72' into linux-linaro-lsklsk-v3.10-15.03
This is the 3.10.72 stable release
Diffstat (limited to 'drivers/tty/tty_ioctl.c')
-rw-r--r-- | drivers/tty/tty_ioctl.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c index 088b4ca7d805..b46aca5cc23c 100644 --- a/drivers/tty/tty_ioctl.c +++ b/drivers/tty/tty_ioctl.c @@ -217,11 +217,17 @@ void tty_wait_until_sent(struct tty_struct *tty, long timeout) #endif if (!timeout) timeout = MAX_SCHEDULE_TIMEOUT; + if (wait_event_interruptible_timeout(tty->write_wait, - !tty_chars_in_buffer(tty), timeout) >= 0) { - if (tty->ops->wait_until_sent) - tty->ops->wait_until_sent(tty, timeout); + !tty_chars_in_buffer(tty), timeout) < 0) { + return; } + + if (timeout == MAX_SCHEDULE_TIMEOUT) + timeout = 0; + + if (tty->ops->wait_until_sent) + tty->ops->wait_until_sent(tty, timeout); } EXPORT_SYMBOL(tty_wait_until_sent); |