]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
tty: teach the n_tty ICANON case about the new "cookie continuations" too
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 20 Jan 2021 23:43:38 +0000 (15:43 -0800)
committerAndrea Righi <andrea.righi@canonical.com>
Mon, 15 Mar 2021 14:10:03 +0000 (15:10 +0100)
commit4fc88a342730b2b9fe0267c5ed0a86a09f0f171c
tree99337e4785b5bc752e12e75eb793175f0276cc32
parentce951632ca481489a48b9c5a68d2493d97b9abe6
tty: teach the n_tty ICANON case about the new "cookie continuations" too

commit d7fe75cbc23c7d225eee2ef04def239b6603dce7 upstream.

The ICANON case is a bit messy, since it has to look for the line
ending, and has special code to then suppress line ending characters if
they match the __DISABLED_CHAR.  So it actually looks up the line ending
even past the point where it knows it won't copy it to the result
buffer.

That said, apart from all those odd legacy N_TTY ICANON cases, the
actual "should we continue copying" logic isn't really all that
complicated or different from the non-canon case.  In fact, the lack of
"wait for at least N characters" arguably makes the repeat case slightly
simpler.  It really just boils down to "there's more of the line to be
copied".

So add the necessarily trivial logic, and now the N_TTY case will give
long result lines even when in canon mode.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/tty/n_tty.c