]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/char/n_tty.c
tty: enable the echoing of ^C in the N_TTY discipline
[mv-sheeva.git] / drivers / char / n_tty.c
index 596c7173997b577d1216d479604435053da4f92f..e0e3815f92bafc4888956b96f87d790936c299f2 100644 (file)
@@ -769,7 +769,21 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
                signal = SIGTSTP;
                if (c == SUSP_CHAR(tty)) {
 send_signal:
-                       isig(signal, tty, 0);
+                       /*
+                        * Echo character, and then send the signal.
+                        * Note that we do not use isig() here because we want
+                        * the order to be:
+                        * 1) flush, 2) echo, 3) signal
+                        */
+                       if (!L_NOFLSH(tty)) {
+                               n_tty_flush_buffer(tty);
+                               if (tty->driver->flush_buffer)
+                                       tty->driver->flush_buffer(tty);
+                       }
+                       if (L_ECHO(tty))
+                               echo_char(c, tty);
+                       if (tty->pgrp)
+                               kill_pgrp(tty->pgrp, signal, 1);
                        return;
                }
        }