tty: Log error if we cannot setup a valid tty keyboard mode
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>
This commit is contained in:
committed by
Kristian Høgsberg
parent
3de191e6b0
commit
592c07a6b9
@@ -199,8 +199,10 @@ tty_create(struct weston_compositor *compositor, tty_vt_func_t vt_func,
|
|||||||
ret = ioctl(tty->fd, KDSKBMODE, K_OFF);
|
ret = ioctl(tty->fd, KDSKBMODE, K_OFF);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ret = ioctl(tty->fd, KDSKBMODE, K_RAW);
|
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;
|
goto err_attr;
|
||||||
|
}
|
||||||
|
|
||||||
tty->input_source = wl_event_loop_add_fd(loop, tty->fd,
|
tty->input_source = wl_event_loop_add_fd(loop, tty->fd,
|
||||||
WL_EVENT_READABLE,
|
WL_EVENT_READABLE,
|
||||||
@@ -209,11 +211,6 @@ tty_create(struct weston_compositor *compositor, tty_vt_func_t vt_func,
|
|||||||
goto err_kdkbmode;
|
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);
|
ret = ioctl(tty->fd, KDSETMODE, KD_GRAPHICS);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
weston_log("failed to set KD_GRAPHICS mode on tty: %m\n");
|
weston_log("failed to set KD_GRAPHICS mode on tty: %m\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user