Skip to content

Commit

Permalink
n_tty: Output bells immediately on a full buffer
Browse files Browse the repository at this point in the history
This patch causes "bell" (^G) characters (invoked when the input buffer
is full) to be immediately output rather than filling the echo buffer.

This is especially a problem when the tty is stopped and buffers fill, since
the bells do not serve their purpose of immediate notification that the
buffer cannot take further input, and they will flush all at once when the
tty is restarted.

Signed-off-by: Joe Peterson <joe@skyrush.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Joe Peterson authored and Linus Torvalds committed Jan 2, 2009
1 parent acc71bb commit 7e94b1d
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions drivers/char/n_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ static void eraser(unsigned char c, struct tty_struct *tty)

/* FIXME: locking needed ? */
if (tty->read_head == tty->canon_head) {
/* echo_char_raw('\a', tty); */ /* what do you think? */
/* process_output('\a', tty); */ /* what do you think? */
return;
}
if (c == ERASE_CHAR(tty))
Expand Down Expand Up @@ -1148,10 +1148,8 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0;
if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) {
/* beep if no space */
if (L_ECHO(tty)) {
echo_char_raw('\a', tty);
process_echoes(tty);
}
if (L_ECHO(tty))
process_output('\a', tty);
return;
}
if (L_ECHO(tty)) {
Expand Down Expand Up @@ -1255,10 +1253,8 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
}
if (c == '\n') {
if (tty->read_cnt >= N_TTY_BUF_SIZE) {
if (L_ECHO(tty)) {
echo_char_raw('\a', tty);
process_echoes(tty);
}
if (L_ECHO(tty))
process_output('\a', tty);
return;
}
if (L_ECHO(tty) || L_ECHONL(tty)) {
Expand All @@ -1280,10 +1276,8 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty))
? 1 : 0;
if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk)) {
if (L_ECHO(tty)) {
echo_char_raw('\a', tty);
process_echoes(tty);
}
if (L_ECHO(tty))
process_output('\a', tty);
return;
}
/*
Expand Down Expand Up @@ -1320,10 +1314,8 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0;
if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) {
/* beep if no space */
if (L_ECHO(tty)) {
echo_char_raw('\a', tty);
process_echoes(tty);
}
if (L_ECHO(tty))
process_output('\a', tty);
return;
}
if (L_ECHO(tty)) {
Expand Down

0 comments on commit 7e94b1d

Please sign in to comment.