Commit Graph

171 Commits

Author SHA1 Message Date
illiliti
f4b2b9331e udev_monitor.c: fail if monitored file is not dir 2021-06-03 09:19:45 +03:00
illiliti
4a6b31b8f1 udev_monitor.c: remove no longer required fcntl.h include 2021-06-03 09:17:39 +03:00
illiliti
0fd4054baf Revert "udev_device.c: replace strncmp with strcmp"
This reverts commit ff6cf67c23.
2021-06-03 07:24:19 +03:00
illiliti
0a1be0e4c0 Revert "contrib/helper.c: replace strncmp with strcmp"
This reverts commit b3f44ae7c9.
2021-06-03 07:23:30 +03:00
illiliti
53aa6f3b04 udev_device.c: abort if uevent file is malformed 2021-06-03 06:27:47 +03:00
illiliti
ff6cf67c23 udev_device.c: replace strncmp with strcmp 2021-06-03 05:28:46 +03:00
illiliti
b3f44ae7c9 contrib/helper.c: replace strncmp with strcmp 2021-06-03 05:19:14 +03:00
illiliti
41d6cc9976 udev_device.c: avoid passing NULL to atoi 2021-06-03 03:21:56 +03:00
illiliti
6dcad515e9 readme: add eventfd to deps 2021-06-01 22:08:50 +03:00
illiliti
93c48c86ec udev_device.c: nitpick 2021-06-01 22:08:00 +03:00
illiliti
e06dfcd22c udev_monitor.c: minor fixes 2021-06-01 17:23:32 +03:00
Arthur Williams
03c53bc1c3 Removed THREAD_MAX and the barrier and pfd fields from udev_monitor
We can fix THREAD_MAX at one since we don't gain much by having multiple
threads. All the threads did were translate inotify events. We also
no longer need pfd and the barrier fields of udev_monitor since we don't
need to signal the single thread or guard against any races.
2021-06-01 03:12:11 +00:00
Arthur Williams
af98e237cb Remove epoll dependency
Instead of using the Linux-specific epoll, we can use the
more portable poll.
2021-06-01 03:12:11 +00:00
illiliti
3d97786f09 udev_device.c: drop PAGESIZE
glibc violates POSIX and does not define it.
2021-05-27 19:13:04 +03:00
illiliti
f44332df5a various: drop udev_* prefix from static functions 2021-05-26 17:55:29 +03:00
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
f2083f0e47 udev_monitor.c: block signals within event loop
Fixes #23
Closes #24
2021-05-25 08:36:56 +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
illiliti
1fd071f24e contrib/helper.sh: exec env command to inherit exit status 2021-05-18 20:27:26 +03:00
illiliti
f1107b0e17 contrib/helper.c: minor fixes
Exit with 2 if arguments are invalid.

Compare unneeded environment variables
with '=' delimiter to avoid false positives.
2021-05-18 20:15:33 +03:00
illiliti
721306c55d contrib/helper.c: make temporary file readable for everyone 2021-05-18 19:30:07 +03:00
illiliti
6685cfaeba add clarification why sys/sysmacros.h must be in udev.h 2021-05-07 10:28:39 +03:00
illiliti
960c902c12 Merge branch 'master' of github.com:illiliti/libudev-zero 2021-05-07 10:22:30 +03:00
illiliti
bbea6a6d90 Merge pull request #21 from TAAPArthur/multi_media_keys
Treat devices with keys as keyboards
2021-05-03 16:53:29 +00: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
illiliti
6ca90e62ee Merge pull request #20 from TAAPArthur/pinephone_touchscreen
Detect touch devices as touchscreen
2021-03-31 13:18:46 +00: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
676c616b02 increment year 2021-02-16 15:15:35 +03:00
illiliti
1aef09bf84 replace unstable pthread_cancel() with self-pipe trick. fixes #16 2021-02-05 05:44:47 +03:00
illiliti
1dfe5144c8 squash 2021-01-26 00:20:57 +03:00
illiliti
8b30ab1692 Merge pull request #15 from mauve/add_missing_log_fn_to_fix_chromium
Add missing udev log functions
2021-01-26 00:24:38 +03:00
Mikael Olenfalk
db8c75e07a Add missing udev log functions
Without these functions Chromium and Electron crash during
startup while loading libudev with a SIGTRAP.
2021-01-21 15:42:54 +01:00
illiliti
eeacecb7a0 Merge branch 'master' of github.com:illiliti/libudev-zero 2021-01-20 09:13:33 +03: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
9868e5e9ea add pthread. fixes #13 2021-01-20 08:55:12 +03:00
illiliti
a2e85c4b53 Merge pull request #10 from mssx86/master
Touch up the README a little.
2020-11-26 07:52:23 +03:00
mssx86
f56e9982ac Touch up the README a little. 2020-11-23 01:53:26 +03:00
illiliti
c1a4550f06 Merge pull request #9 from E5ten/fix-pc
libudev.pc: add prefix and exec_prefix support
2020-11-11 20:56:16 +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
3b3d86d666 guard against multiple inclusion 2020-11-11 20:37:29 +03:00
Ethan Sommer
5cebefbc85 libudev.pc: add prefix and exec_prefix support 2020-11-04 14:48:17 -05: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
bb6cc905dd update readme 2020-09-16 02:43:37 +03:00
illiliti
fd64152df9 prevent format string exploit 2020-09-15 02:38:57 +03:00
illiliti
7cdcebdf58 drop libudev.pc from all 2020-09-15 01:49:49 +03:00