Fixed some bugs in BREAK handling. If BRKINT is set, then always flush

the queues and generate a SIGINT.  Previously, this wasn't done if ISIG
was clear or the VINTR character was disabled, and it was done by
converting the BREAK to a VINTR character and sometimes bogusly echoing
this character.

Found by:	NIST-PCTS
This commit is contained in:
bde 1996-11-29 15:23:42 +00:00
parent 763b4f77a0
commit 9d16d9154e

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)tty.c 8.8 (Berkeley) 1/21/94 * @(#)tty.c 8.8 (Berkeley) 1/21/94
* $Id: tty.c,v 1.84 1996/08/31 16:52:26 bde Exp $ * $Id: tty.c,v 1.85 1996/11/29 15:06:09 bde Exp $
*/ */
/*- /*-
@ -326,14 +326,15 @@ ttyinput(c, tp)
err = (ISSET(c, TTY_ERRORMASK)); err = (ISSET(c, TTY_ERRORMASK));
if (err) { if (err) {
CLR(c, TTY_ERRORMASK); CLR(c, TTY_ERRORMASK);
if (ISSET(err, TTY_BI)) { /* Break. */ if (ISSET(err, TTY_BI)) {
if (ISSET(iflag, IGNBRK)) if (ISSET(iflag, IGNBRK))
return (0); return (0);
else if (ISSET(iflag, BRKINT) && if (ISSET(iflag, BRKINT)) {
ISSET(lflag, ISIG) && ttyflush(tp, FREAD | FWRITE);
(cc[VINTR] != _POSIX_VDISABLE)) pgsignal(tp->t_pgrp, SIGINT, 1);
c = cc[VINTR]; goto endcase;
else if (ISSET(iflag, PARMRK)) }
if (ISSET(iflag, PARMRK))
goto parmrk; goto parmrk;
} else if ((ISSET(err, TTY_PE) && ISSET(iflag, INPCK)) } else if ((ISSET(err, TTY_PE) && ISSET(iflag, INPCK))
|| ISSET(err, TTY_FE)) { || ISSET(err, TTY_FE)) {