mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-03-22 09:10:40 +01:00
fallback: log an error if we failed to write the switch event
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
b170993b74
commit
2fc394dcde
1 changed files with 8 additions and 1 deletions
|
|
@ -924,12 +924,19 @@ fallback_lid_keyboard_event(uint64_t time,
|
|||
|
||||
if (dispatch->lid.reliability == RELIABILITY_WRITE_OPEN) {
|
||||
int fd = libevdev_get_fd(dispatch->device->evdev);
|
||||
int rc;
|
||||
struct input_event ev[2] = {
|
||||
{{ 0, 0 }, EV_SW, SW_LID, 0 },
|
||||
{{ 0, 0 }, EV_SYN, SYN_REPORT, 0 },
|
||||
};
|
||||
|
||||
(void)write(fd, ev, sizeof(ev));
|
||||
rc = write(fd, ev, sizeof(ev));
|
||||
|
||||
if (rc < 0)
|
||||
evdev_log_error(dispatch->device,
|
||||
"failed to write SW_LID state (%s)",
|
||||
strerror(errno));
|
||||
|
||||
/* In case write() fails, we sync the lid state manually
|
||||
* regardless. */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue