n_tty: Fix apparent order of echoed output
authorPeter Hurley <peter@hurleysoftware.com>
Mon, 9 Dec 2013 23:06:07 +0000 (18:06 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2014 20:25:07 +0000 (12:25 -0800)
commit8416877c8da5a637321121d8cad70419dd27fe59
treed3cbf8acb831525ca4abe6c356170c8952bd115f
parentab69be3e59d79c56bfe16930f0c761daf4837e48
n_tty: Fix apparent order of echoed output

commit 1075a6e2dc7e2a96efc417b98dd98f57fdae985d upstream.

With block processing of echoed output, observed output order is still
required. Push completed echoes and echo commands prior to output.

Introduce echo_mark echo buffer index, which tracks completed echo
commands; ie., those submitted via commit_echoes but which may not
have been committed. Ensure that completed echoes are output prior
to subsequent terminal writes in process_echoes().

Fixes newline/prompt output order in cooked mode shell.

Reported-by: Karl Dahlke <eklhad@comcast.net>
Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Karl Dahlke <eklhad@comcast.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c