From 7542ee31b8a22dcef9faa3e51c97945ac8f6fd5a Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Fri, 29 Nov 1996 15:23:42 +0000 Subject: [PATCH] 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 --- sys/kern/tty.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index fab7c83d7440..0da2fca5f982 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)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)); if (err) { CLR(c, TTY_ERRORMASK); - if (ISSET(err, TTY_BI)) { /* Break. */ + if (ISSET(err, TTY_BI)) { if (ISSET(iflag, IGNBRK)) return (0); - else if (ISSET(iflag, BRKINT) && - ISSET(lflag, ISIG) && - (cc[VINTR] != _POSIX_VDISABLE)) - c = cc[VINTR]; - else if (ISSET(iflag, PARMRK)) + if (ISSET(iflag, BRKINT)) { + ttyflush(tp, FREAD | FWRITE); + pgsignal(tp->t_pgrp, SIGINT, 1); + goto endcase; + } + if (ISSET(iflag, PARMRK)) goto parmrk; } else if ((ISSET(err, TTY_PE) && ISSET(iflag, INPCK)) || ISSET(err, TTY_FE)) {