setconsole: open console for writing rather than reading
authorPeter Korsgaard <jacmet@sunsite.dk>
Thu, 26 May 2011 15:51:37 +0000 (17:51 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 28 May 2011 23:51:33 +0000 (01:51 +0200)
commit8dc6195c97e6bfc70a0158bce40c87d74d1a83d6
tree3e428027ff4670b245da7f21ae726d5cb800df14
parentabb0952e63ed09a5bd5d73346305f6403b45d47d
setconsole: open console for writing rather than reading

The console passed to TIOCCONS has to be writable, otherwise future
console writes will fail.

This presumably used to work, but in current kernels (see
drivers/tty/tty_io.c:redirected_tty_write) console writes are sent to
vfs_write(device), which checks if the device is writable. A quick look
in the linux git history doesn't show any recent changes to either tty_io
or vfs_write.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
console-tools/setconsole.c