1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

1. If some output still present at the end of ttywait, kill it.

2. Even if ttywait() fails, call ttyflush(FREAD) in ttywflush.
This two fixes guarantee that queues are empty after calling ttywflush()
in any case
This commit is contained in:
Andrey A. Chernov 1995-02-12 23:01:13 +00:00
parent bb71d76710
commit 911b598f11
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6331

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.c 8.8 (Berkeley) 1/21/94
* $Id: tty.c,v 1.20 1995/02/08 22:02:02 bde Exp $
* $Id: tty.c,v 1.21 1995/02/09 11:13:30 jkh Exp $
*/
#include <sys/param.h>
@ -1005,12 +1005,15 @@ ttywait(tp)
break;
}
}
/* If some output still there, kill it */
if (tp->t_outq.c_cc || ISSET(tp->t_state, TS_BUSY))
ttyflush(tp, FWRITE);
splx(s);
return (error);
}
/*
* Flush if successfully wait.
* Flush after waiting.
*/
int
ttywflush(tp)
@ -1018,8 +1021,8 @@ ttywflush(tp)
{
int error;
if ((error = ttywait(tp)) == 0)
ttyflush(tp, FREAD);
error = ttywait(tp);
ttyflush(tp, FREAD);
return (error);
}