diff options
| author | Ingo Molnar <mingo@kernel.org> | 2015-03-31 09:08:13 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2015-03-31 09:08:13 +0200 |
| commit | c5e77f5216abdd1d98e6d14d9a3eb4e88d80011a (patch) | |
| tree | a542b5bb7d96a8f37c4d5e3319086064448ed67b /drivers/tty/tty_ioctl.c | |
| parent | de81e64b250d3865a75d221a80b4311e3273670a (diff) | |
| parent | e42391cd048809d903291d07f86ed3934ce138e9 (diff) | |
Merge tag 'v4.0-rc6' into timers/core, before applying new patches
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/tty/tty_ioctl.c')
| -rw-r--r-- | drivers/tty/tty_ioctl.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c index a5cf253b2544..632fc8152061 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); - } + + timeout = wait_event_interruptible_timeout(tty->write_wait, + !tty_chars_in_buffer(tty), timeout); + if (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); |
