patch-2.0.1 linux/drivers/char/n_tty.c

Next file: linux/drivers/char/pty.c
Previous file: linux/drivers/char/mem.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.0/linux/drivers/char/n_tty.c linux/drivers/char/n_tty.c
@@ -201,7 +201,7 @@
 			tty->read_head = tty->canon_head;
 			return;
 		}
-		if (!L_ECHOK(tty) || !L_ECHOKE(tty)) {
+		if (!L_ECHOK(tty) || !L_ECHOKE(tty) || !L_ECHOE(tty)) {
 			tty->read_cnt -= ((tty->read_head - tty->canon_head) &
 					  (N_TTY_BUF_SIZE - 1));
 			tty->read_head = tty->canon_head;
@@ -236,7 +236,7 @@
 					tty->erasing = 1;
 				}
 				echo_char(c, tty);
-			} else if (!L_ECHOE(tty)) {
+			} else if (kill_type == ERASE && !L_ECHOE(tty)) {
 				echo_char(ERASE_CHAR(tty), tty);
 			} else if (c == '\t') {
 				unsigned int col = tty->canon_column;
@@ -290,11 +290,11 @@
 		finish_erasing(tty);
 }
 
-static void isig(int sig, struct tty_struct *tty)
+static inline void isig(int sig, struct tty_struct *tty, int flush)
 {
 	if (tty->pgrp > 0)
 		kill_pg(tty->pgrp, sig, 1);
-	if (!L_NOFLSH(tty)) {
+	if (flush || !L_NOFLSH(tty)) {
 		n_tty_flush_buffer(tty);
 		if (tty->driver.flush_buffer)
 			tty->driver.flush_buffer(tty);
@@ -306,7 +306,7 @@
 	if (I_IGNBRK(tty))
 		return;
 	if (I_BRKINT(tty)) {
-		isig(SIGINT, tty);
+		isig(SIGINT, tty, 1);
 		return;
 	}
 	if (I_PARMRK(tty)) {
@@ -340,8 +340,10 @@
 		put_tty_queue('\377', tty);
 		put_tty_queue('\0', tty);
 		put_tty_queue(c, tty);
-	} else
+	} else	if (I_INPCK(tty))
 		put_tty_queue('\0', tty);
+	else
+		put_tty_queue(c, tty);
 	wake_up_interruptible(&tty->read_wait);
 }
 
@@ -415,17 +417,17 @@
 		}
 	}
 	if (L_ISIG(tty)) {
-		if (c == INTR_CHAR(tty)) {
-			isig(SIGINT, tty);
-			return;
-		}
-		if (c == QUIT_CHAR(tty)) {
-			isig(SIGQUIT, tty);
-			return;
-		}
+		int signal;
+		signal = SIGINT;
+		if (c == INTR_CHAR(tty))
+			goto send_signal;
+		signal = SIGQUIT;
+		if (c == QUIT_CHAR(tty))
+			goto send_signal;
+		signal = SIGTSTP;
 		if (c == SUSP_CHAR(tty)) {
-			if (!is_orphaned_pgrp(tty->pgrp))
-				isig(SIGTSTP, tty);
+send_signal:
+			isig(signal, tty, 0);
 			return;
 		}
 	}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov