kbd_mode: try harder to find console device if -C TTY is not given
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 6 Aug 2017 10:17:46 +0000 (12:17 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 6 Aug 2017 10:17:46 +0000 (12:17 +0200)
commit32b60cc0db90e517399ca9fa73a8ac1140db810d
treeecc6d2bb067319f1c9511cc5e04d4e6eb0ec302b
parent6517bbc76c5e79273f72b951362125241552935d
kbd_mode: try harder to find console device if -C TTY is not given

Was (under X):
$ ./busybox_old kbd_mode
kbd_mode: ioctl 0x4b44 failed: Inappropriate ioctl for device
Now:
$ ./busybox kbd_mode
The keyboard is in off mode

function                                             old     new   delta
kbd_mode_main                                        166     174      +8
packed_usage                                       31782   31764     -18
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 8/-18)             Total: -10 bytes
   text    data     bss     dec     hex filename
 915757     485    6880  923122   e15f2 busybox_old
 915747     485    6880  923112   e15e8 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
console-tools/kbd_mode.c
libbb/get_console.c