The previous logging code would never be reached - this change makes sure a
message is reported if changing keyboard mode to either the desired (K_OFF) or
fallback (K_RAW with handler that drops the events) fails.
Signed-off-by: Rob Bradford <rob@linux.intel.com>
ret = ioctl(tty->fd, KDSKBMODE, K_OFF);
if (ret) {
ret = ioctl(tty->fd, KDSKBMODE, K_RAW);
- if (ret)
+ if (ret) {
+ weston_log("failed to set keyboard mode on tty: %m\n");
goto err_attr;
+ }
tty->input_source = wl_event_loop_add_fd(loop, tty->fd,
WL_EVENT_READABLE,
goto err_kdkbmode;
}
- if (ret) {
- weston_log("failed to set K_OFF keyboard mode on tty: %m\n");
- goto err_attr;
- }
-
ret = ioctl(tty->fd, KDSETMODE, KD_GRAPHICS);
if (ret) {
weston_log("failed to set KD_GRAPHICS mode on tty: %m\n");