aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/n_tty.c
diff options
context:
space:
mode:
authorJoe Peterson <joe@skyrush.com>2009-01-02 13:43:40 +0000
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-02 10:19:37 -0800
commit7e94b1d9bffc18dca3b45554d9d118a3ffcc4d1b (patch)
treeab01290ff857f343332e9e4b28540300886dc89e /drivers/char/n_tty.c
parentn_tty: Fix hanfling of buffer full corner cases (diff)
downloadlinux-dev-7e94b1d9bffc18dca3b45554d9d118a3ffcc4d1b.tar.xz
linux-dev-7e94b1d9bffc18dca3b45554d9d118a3ffcc4d1b.zip
n_tty: Output bells immediately on a full buffer
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>
Diffstat (limited to 'drivers/char/n_tty.c')
-rw-r--r--drivers/char/n_tty.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 4b1e96b65ab0..3922a084205e 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -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))
@@ -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)) {
@@ -1255,10 +1253,8 @@ send_signal:
}
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)) {
@@ -1280,10 +1276,8 @@ send_signal:
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;
}
/*
@@ -1320,10 +1314,8 @@ handle_newline:
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)) {