n_tty: Fix EOF push index when termios changes
Commit 40d5e0905a
,
'n_tty: Fix EOF push handling' introduced a subtle state
change error wrt EOF push handling when the termios is
changed from non-canonical to canonical mode.
Reset line_start to the current read_tail index, not 0.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
0b53861230
Коммит
93a8d4163e
|
@ -1758,8 +1758,7 @@ static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
|
||||||
canon_change = (old->c_lflag ^ tty->termios.c_lflag) & ICANON;
|
canon_change = (old->c_lflag ^ tty->termios.c_lflag) & ICANON;
|
||||||
if (canon_change) {
|
if (canon_change) {
|
||||||
bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE);
|
bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE);
|
||||||
ldata->line_start = 0;
|
ldata->line_start = ldata->canon_head = ldata->read_tail;
|
||||||
ldata->canon_head = ldata->read_tail;
|
|
||||||
ldata->erasing = 0;
|
ldata->erasing = 0;
|
||||||
ldata->lnext = 0;
|
ldata->lnext = 0;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче