Subject: tty.c buffer overflow?
To: None <port-arm32@netbsd.org>
From: David McConnell <davem@eastcoast.co.za>
List: port-arm32
Date: 03/23/2000 18:05:53
Hi There
In "tty.c" ttyinput() has a check for too many characters in its input
queues, as follows:
/*
* Check for input buffer overflow
*/
if (tp->t_rawq.c_cc + tp->t_canq.c_cc >= TTYHOG) {
if (ISSET(iflag, IMAXBEL)) {
if (tp->t_outq.c_cc < tp->t_hiwat)
(void)ttyoutput(CTRL('g'), tp);
} else
printf("\n6\n");
ttyflush(tp, FREAD | FWRITE);
goto endcase;
My question is why does the "ttyflush" have FWRITE specified as well? I mean
this is an input queue problem, why flush the output queue?
It seems to me it causes output data to be unnecessarily lost?
Am I missing something here, or was it just an oversight?
Thanks!
Cheers
David