]> granicus.if.org Git - strace/commit
evdev: fix decoding of EVIOCGBIT(0, ...)
authorZhibin Li <08826794brmt@gmail.com>
Wed, 1 Aug 2018 09:53:57 +0000 (17:53 +0800)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 19 Aug 2018 10:26:18 +0000 (10:26 +0000)
commit5ee385e2eb9288ae49e07dca67e576abb2e10fea
tree9eeb7e581ef2a31fdc288f6af0ce7f58d20f3a1d
parent99300f217b7870fcaa752e1350a33cf98d61a993
evdev: fix decoding of EVIOCGBIT(0, ...)

There is a comment in drivers/input/evdev.c which says:
/* EV_SYN==0 is EV_CNT, _not_ SYN_CNT, see EVIOCGBIT */

That is, EVIOCGBIT(0, ...) should return a bit mask with supported
event types instead of SYN_* event codes.

* defs.h (evdev_ev): New prototype.
* evdev.c: Include "xlat/evdev_ev.h" and remove "xlat/evdev_sync.h".
(bit_ioctl) <case EV_SYN>: Replace EV_SYN with 0, use evdev_ev
with XT_SORTED in decode_bitset invocation instead.
* ioctl.c: Do not include "xlat/evdev_ev.h".
(evdev_decode_number): Print nr == 0x20 as "0" instead of "EV_SYN".
* tests/ioctl_evdev.c (main): Use 0 instead of EV_SYN in EVIOCGBIT
output.
* xlat/evdev_sync.in: Remove.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
Fixes: v4.10~89 "Add decoding for evdev ioctls"
defs.h
evdev.c
ioctl.c
tests/ioctl_evdev.c
xlat/evdev_sync.in [deleted file]