aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJoe Peterson <joe@skyrush.com>2009-01-02 08:43:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-02 13:19:37 -0500
commit7e94b1d9bffc18dca3b45554d9d118a3ffcc4d1b (patch)
treeab01290ff857f343332e9e4b28540300886dc89e /drivers
parentacc71bbad33478973dbed68ebbc2d76dac9a51bd (diff)
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')
-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)
872 872
873 /* FIXME: locking needed ? */ 873 /* FIXME: locking needed ? */
874 if (tty->read_head == tty->canon_head) { 874 if (tty->read_head == tty->canon_head) {
875 /* echo_char_raw('\a', tty); */ /* what do you think? */ 875 /* process_output('\a', tty); */ /* what do you think? */
876 return; 876 return;
877 } 877 }
878 if (c == ERASE_CHAR(tty)) 878 if (c == ERASE_CHAR(tty))
@@ -1148,10 +1148,8 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
1148 parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0; 1148 parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0;
1149 if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) { 1149 if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) {
1150 /* beep if no space */ 1150 /* beep if no space */
1151 if (L_ECHO(tty)) { 1151 if (L_ECHO(tty))
1152 echo_char_raw('\a', tty); 1152 process_output('\a', tty);
1153 process_echoes(tty);
1154 }
1155 return; 1153 return;
1156 } 1154 }
1157 if (L_ECHO(tty)) { 1155 if (L_ECHO(tty)) {
@@ -1255,10 +1253,8 @@ send_signal:
1255 } 1253 }
1256 if (c == '\n') { 1254 if (c == '\n') {
1257 if (tty->read_cnt >= N_TTY_BUF_SIZE) { 1255 if (tty->read_cnt >= N_TTY_BUF_SIZE) {
1258 if (L_ECHO(tty)) { 1256 if (L_ECHO(tty))
1259 echo_char_raw('\a', tty); 1257 process_output('\a', tty);
1260 process_echoes(tty);
1261 }
1262 return; 1258 return;
1263 } 1259 }
1264 if (L_ECHO(tty) || L_ECHONL(tty)) { 1260 if (L_ECHO(tty) || L_ECHONL(tty)) {
@@ -1280,10 +1276,8 @@ send_signal:
1280 parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) 1276 parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty))
1281 ? 1 : 0; 1277 ? 1 : 0;
1282 if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk)) { 1278 if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk)) {
1283 if (L_ECHO(tty)) { 1279 if (L_ECHO(tty))
1284 echo_char_raw('\a', tty); 1280 process_output('\a', tty);
1285 process_echoes(tty);
1286 }
1287 return; 1281 return;
1288 } 1282 }
1289 /* 1283 /*
@@ -1320,10 +1314,8 @@ handle_newline:
1320 parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0; 1314 parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0;
1321 if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) { 1315 if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) {
1322 /* beep if no space */ 1316 /* beep if no space */
1323 if (L_ECHO(tty)) { 1317 if (L_ECHO(tty))
1324 echo_char_raw('\a', tty); 1318 process_output('\a', tty);
1325 process_echoes(tty);
1326 }
1327 return; 1319 return;
1328 } 1320 }
1329 if (L_ECHO(tty)) { 1321 if (L_ECHO(tty)) {