Commit Graph

69 Commits

Author SHA1 Message Date
illiliti
0ea1528dfc udev_device.c: simplify bounds checking 2021-05-26 14:33:27 +03:00
illiliti
4b044ae52c udev_device.c: avoid off-by-one overflow 2021-05-26 13:37:02 +03:00
illiliti
145e2c814f udev_device.c: attempt to fix incorrect bitmask handling
Reference #22
2021-05-25 15:34:24 +03:00
illiliti
a885b93c3c udev_device.c: correctly handle multiline sysattrs
Changed arbitrary size of sysattr to PAGESIZE[0]. Not sure about binary
sysattrs because they may be > PAGESIZE. Either way, we need dynamic
allocation to handle them.

Trim only trailing newlines, not the first one. Now content of the
sysattr not getting truncated. By the way, do we need to trim carrige
return '\r' too?

[0] https://www.kernel.org/doc/Documentation/filesystems/sysfs.txt

> The buffer will always be PAGE_SIZE bytes in length. On i386, this
  is 4096.

Fixes #25
2021-05-21 05:49:41 +03:00
Arthur Williams
3d188e78e8 Treat devices with keys as keyboards
Some keyboards have an absolute axis and would erroneously not be treated
as a keyboard. Now any device with keys would have the ID_INPUT_KEY
property set.
2021-05-03 11:51:35 -05:00
Arthur Williams
048701fa5f Detect touch devices as touchscreen
The Goodix Capacitive TouchScreen on the pinephone was being detected as
a joystick instead of a touchscreen. This patch correctly marks it as a
touchscreen and allows it to work out of the box with libinput
2021-03-16 19:12:58 -05:00
illiliti
84dcea670c define INPUT_PROP_{POINTING_STICK,ACCELEROMETER}. fixes #11 2021-01-20 09:10:29 +03:00
illiliti
d9bd4f3a19 implement udev_device_get_usec_since_initialized. fixes #12, closes #14 2021-01-20 09:05:42 +03:00
illiliti
b90b0acc88 general code cleanup 2021-01-20 08:58:19 +03:00
illiliti
68b42a2404 implement udev_device_get_seqnum. closes #7 2020-11-11 20:49:20 +03:00
illiliti
4e31ed15b5 add todo 2020-11-11 20:37:54 +03:00
illiliti
be97914ade move not implemented comment to the same line of function for easier parsability 2020-09-16 21:51:08 +03:00
illiliti
089e09e00a fix memory leak 2020-09-13 23:26:40 +03:00
illiliti
0c4d64fdac fix xorg crash introduced in 74b7427c41 2020-09-01 14:03:07 +03:00
illiliti
14e187f1e2 check file size 2020-08-23 15:31:10 +03:00
illiliti
894aa48906 fix memory leak 2020-08-23 15:23:36 +03:00
illiliti
b54f639cfd final fixes 2020-08-23 00:51:10 +03:00
illiliti
bcd28de858 fix potential UB while reading sysattr 2020-08-16 14:00:03 +03:00
illiliti
408249b34b simplify key=val parsing 2020-08-16 12:53:13 +03:00
illiliti
752f500a90 grab properties from uevent 2020-08-15 12:20:24 +03:00
illiliti
508424a3a2 fix sysname 2020-08-15 07:39:02 +03:00
illiliti
380e7f8890 implement hotplugging support 2020-08-14 19:33:18 +03:00
illiliti
56bcf25461 minor fixes, add joystick support 2020-08-12 23:31:37 +03:00
illiliti
dc75e2b44e correctly find ID_INPUT_KEY 2020-08-10 00:48:02 +03:00
illiliti
ca956fa663 add support for tablets, pointing sticks and accelerometers 2020-08-09 07:05:09 +03:00
illiliti
011d3db9e1 check if switch has EV_KEY capability 2020-08-07 05:42:20 +03:00
illiliti
25977fddb5 cleanup 2020-08-04 21:32:06 +03:00
illiliti
c0d6c58393 switch to for loop 2020-08-04 16:11:17 +03:00
illiliti
7754aa691c prevent array index out of bounds 2020-08-03 18:37:40 +03:00
illiliti
8fa88d6697 remove useless NULL checks 2020-08-03 00:05:12 +03:00
illiliti
3700b9c642 check NULL 2020-08-02 15:50:17 +03:00
illiliti
a41459e81c fix broken input 2020-08-01 18:31:29 +03:00
illiliti
8547b55072 use buffered io 2020-08-01 04:20:27 +03:00
illiliti
fca883ed54 get rid of ioctl
before - 2.964 total
after  - 0.932 total

still slow ???
2020-08-01 03:23:56 +03:00
illiliti
8a57e66afe pass O_NONBLOCK to open 2020-07-31 22:12:29 +03:00
illiliti
8c30f20b7e change logic 2020-07-31 21:30:38 +03:00
illiliti
314f1b005a change style 2020-07-31 01:19:27 +03:00
illiliti
e751c69241 do not try to search parent device very deeply 2020-07-31 01:13:41 +03:00
illiliti
bfd09f153e simplify logic 2020-07-31 00:28:09 +03:00
illiliti
37fe740623 check NULL before open devnode 2020-07-31 00:12:50 +03:00
illiliti
a0528c5585 check NULL 2020-07-31 00:08:37 +03:00
illiliti
9b7641d9ec do not handle unique values when no need 2020-07-29 12:27:40 +03:00
illiliti
edaf268cac const char where possible 2020-07-29 12:09:11 +03:00
illiliti
56537c691a no need 2020-07-26 18:50:42 +03:00
illiliti
f63ec4a2e7 minor changes 2020-07-26 15:49:15 +03:00
illiliti
a5d5e4dd2b fix gcc 10 2020-07-26 12:34:43 +03:00
illiliti
b9ab0e2fe9 use limits constants instead of hardcoded ones 2020-07-25 17:48:37 +03:00
illiliti
984295b4a0 minor fixes 2020-07-25 17:42:47 +03:00
illiliti
d05676f232 drop O_NOFOLLOW 2020-07-25 16:44:17 +03:00
illiliti
d4a60c10c0 use readlink 2020-07-25 16:41:10 +03:00