cttyhack: handle multiple consoles found in sysfs
authorAaro Koskinen <aaro.koskinen@iki.fi>
Sat, 4 Feb 2012 20:55:01 +0000 (21:55 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 4 Feb 2012 20:55:01 +0000 (21:55 +0100)
commit6e9d047c1558f92531ea12b9e3206023ab77cf51
tree5c1c7b2d8b20fc64d18208075282b771287678ba
parentef43beac63aa7e4b2bccb069e47b5e4902bb895f
cttyhack: handle multiple consoles found in sysfs

If multiple consoles are found from the sysfs file, cttyhack fails:

cttyhack: can't open '/dev/tty0 ttyS0': No such file or directory

In such cases take the last one as the kernel will use that one for
/dev/console.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/cttyhack.c