aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/n_tty.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r--drivers/tty/n_tty.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index cb8017aa4434..d15624c1b751 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -817,8 +817,7 @@ static void process_echoes(struct tty_struct *tty)
817 struct n_tty_data *ldata = tty->disc_data; 817 struct n_tty_data *ldata = tty->disc_data;
818 size_t echoed; 818 size_t echoed;
819 819
820 if ((!L_ECHO(tty) && !L_ECHONL(tty)) || 820 if (ldata->echo_mark == ldata->echo_tail)
821 ldata->echo_mark == ldata->echo_tail)
822 return; 821 return;
823 822
824 mutex_lock(&ldata->output_lock); 823 mutex_lock(&ldata->output_lock);
@@ -1244,7 +1243,8 @@ n_tty_receive_signal_char(struct tty_struct *tty, int signal, unsigned char c)
1244 if (L_ECHO(tty)) { 1243 if (L_ECHO(tty)) {
1245 echo_char(c, tty); 1244 echo_char(c, tty);
1246 commit_echoes(tty); 1245 commit_echoes(tty);
1247 } 1246 } else
1247 process_echoes(tty);
1248 isig(signal, tty); 1248 isig(signal, tty);
1249 return; 1249 return;
1250} 1250}
@@ -1274,7 +1274,7 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
1274 if (I_IXON(tty)) { 1274 if (I_IXON(tty)) {
1275 if (c == START_CHAR(tty)) { 1275 if (c == START_CHAR(tty)) {
1276 start_tty(tty); 1276 start_tty(tty);
1277 commit_echoes(tty); 1277 process_echoes(tty);
1278 return 0; 1278 return 0;
1279 } 1279 }
1280 if (c == STOP_CHAR(tty)) { 1280 if (c == STOP_CHAR(tty)) {
@@ -1820,8 +1820,10 @@ static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
1820 * Fix tty hang when I_IXON(tty) is cleared, but the tty 1820 * Fix tty hang when I_IXON(tty) is cleared, but the tty
1821 * been stopped by STOP_CHAR(tty) before it. 1821 * been stopped by STOP_CHAR(tty) before it.
1822 */ 1822 */
1823 if (!I_IXON(tty) && old && (old->c_iflag & IXON) && !tty->flow_stopped) 1823 if (!I_IXON(tty) && old && (old->c_iflag & IXON) && !tty->flow_stopped) {
1824 start_tty(tty); 1824 start_tty(tty);
1825 process_echoes(tty);
1826 }
1825 1827
1826 /* The termios change make the tty ready for I/O */ 1828 /* The termios change make the tty ready for I/O */
1827 if (waitqueue_active(&tty->write_wait)) 1829 if (waitqueue_active(&tty->write_wait))
@@ -1896,7 +1898,7 @@ err:
1896static inline int input_available_p(struct tty_struct *tty, int poll) 1898static inline int input_available_p(struct tty_struct *tty, int poll)
1897{ 1899{
1898 struct n_tty_data *ldata = tty->disc_data; 1900 struct n_tty_data *ldata = tty->disc_data;
1899 int amt = poll && !TIME_CHAR(tty) ? MIN_CHAR(tty) : 1; 1901 int amt = poll && !TIME_CHAR(tty) && MIN_CHAR(tty) ? MIN_CHAR(tty) : 1;
1900 1902
1901 if (ldata->icanon && !L_EXTPROC(tty)) { 1903 if (ldata->icanon && !L_EXTPROC(tty)) {
1902 if (ldata->canon_head != ldata->read_tail) 1904 if (ldata->canon_head != ldata->read_tail)