mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2026-01-07 04:10:12 +01:00
Disallow disabling EV_SYN event codes
The documentation already says that, make it happen. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
parent
b15e5987b3
commit
03c3e4f975
2 changed files with 2 additions and 1 deletions
|
|
@ -1213,7 +1213,7 @@ libevdev_disable_event_code(struct libevdev *dev, unsigned int type, unsigned in
|
|||
unsigned int max;
|
||||
unsigned long *mask = NULL;
|
||||
|
||||
if (type > EV_MAX)
|
||||
if (type > EV_MAX || type == EV_SYN)
|
||||
return -1;
|
||||
|
||||
max = type_to_mask(dev, type, &mask);
|
||||
|
|
|
|||
|
|
@ -847,6 +847,7 @@ START_TEST(test_device_disable_bit_invalid)
|
|||
ck_assert_int_eq(libevdev_disable_event_code(dev, EV_MAX + 1, ABS_MAX + 1), -1);
|
||||
ck_assert_int_eq(libevdev_disable_event_type(dev, EV_MAX + 1), -1);
|
||||
ck_assert_int_eq(libevdev_disable_event_type(dev, EV_SYN), -1);
|
||||
ck_assert_int_eq(libevdev_disable_event_code(dev, EV_SYN, SYN_REPORT), -1);
|
||||
|
||||
uinput_device_free(uidev);
|
||||
libevdev_free(dev);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue