diff options
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) | |||
217 | #endif | 217 | #endif |
218 | if (!timeout) | 218 | if (!timeout) |
219 | timeout = MAX_SCHEDULE_TIMEOUT; | 219 | timeout = MAX_SCHEDULE_TIMEOUT; |
220 | if (wait_event_interruptible_timeout(tty->write_wait, | 220 | |
221 | !tty_chars_in_buffer(tty), timeout) >= 0) { | 221 | timeout = wait_event_interruptible_timeout(tty->write_wait, |
222 | if (tty->ops->wait_until_sent) | 222 | !tty_chars_in_buffer(tty), timeout); |
223 | tty->ops->wait_until_sent(tty, timeout); | 223 | if (timeout <= 0) |
224 | } | 224 | return; |
225 | |||
226 | if (timeout == MAX_SCHEDULE_TIMEOUT) | ||
227 | timeout = 0; | ||
228 | |||
229 | if (tty->ops->wait_until_sent) | ||
230 | tty->ops->wait_until_sent(tty, timeout); | ||
225 | } | 231 | } |
226 | EXPORT_SYMBOL(tty_wait_until_sent); | 232 | EXPORT_SYMBOL(tty_wait_until_sent); |
227 | 233 | ||