]> git.baikalelectronics.ru Git - kernel.git/commit
tty: n_tty: fix SIGIO for output
authorPeter Hurley <peter@hurleysoftware.com>
Sun, 10 Jan 2016 05:45:14 +0000 (21:45 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Jan 2016 19:58:02 +0000 (11:58 -0800)
commitc6cec293bfa53293c1e91d3726ed91c79d768d95
tree702f4aad21688cc01a3a92d4f2207bf408aa3615
parente1cff84fa21ea5836b171e558727cdcc1165538f
tty: n_tty: fix SIGIO for output

According to fcntl(2), "a SIGIO signal is sent whenever input
or output becomes possible on that file descriptor", i.e.
after the output buffer was full and now has space for new data.
But in fact SIGIO is sent after every write.

n_tty_write() should set TTY_DO_WRITE_WAKEUP only when
not all data could be written to the buffer.

[pjh: Also fixes missed SIGIO if amt written just happens to be
[     amount still to write

Signed-off-by: Johannes Stezenbach <js@sig21.net>
[pjh: minor patch edits and re-submit]

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c