diff options
author | bde <bde@FreeBSD.org> | 1996-11-29 15:23:42 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1996-11-29 15:23:42 +0000 |
commit | d1ee68c0c085d90bbbf81cd836d539349835ea45 (patch) | |
tree | 2b9309e51df8860b09fd6317fdac59b3199e3578 | |
parent | 3d3ae943381a0da8785149061fb7bcd686838703 (diff) | |
download | FreeBSD-src-d1ee68c0c085d90bbbf81cd836d539349835ea45.zip FreeBSD-src-d1ee68c0c085d90bbbf81cd836d539349835ea45.tar.gz |
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
-rw-r--r-- | sys/kern/tty.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index fab7c83..0da2fca 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)) { |