MFC r259441:

Properly drain the TTY when both revoke(2) and close(2) end up closing
the TTY.
This commit is contained in:
marcel 2014-02-16 20:37:39 +00:00
parent 6c90e2f6f5
commit 091cb7eeea

View File

@ -191,8 +191,10 @@ ttydev_leave(struct tty *tp)
/* Drain any output. */
MPASS((tp->t_flags & TF_STOPPED) == 0);
if (!tty_gone(tp))
tty_drain(tp);
if (!tty_gone(tp)) {
while (tty_drain(tp) == ERESTART)
;
}
ttydisc_close(tp);