Commit Graph

182 Commits

Author SHA1 Message Date
illiliti a81cb4444d udev_device.c: decrement size by 1
SUBSYSTEM == 9, not 10. same for others
2021-06-03 12:06:18 +03:00
illiliti 4cb97cd01e udev_device.c: use strncmp to compare uevent vars 2021-06-03 12:02:40 +03:00
illiliti 4623040b6c udev_monitor.c: free resources before return 2021-06-03 11:53:29 +03:00
illiliti 802c5b8695 udev_enumerate.c: check return value of pthread_create 2021-06-03 11:44:50 +03:00
illiliti b82f9d9e4f udev.c: move udev_hwdb here 2021-06-03 11:35:08 +03:00
illiliti e814cfa506 udev_device.c: fix possible uninitialized read 2021-06-03 11:20:51 +03:00
illiliti 496291c8dd udev_monitor.c: add a way to control UDEV_MONITOR_DIR at runtime 2021-06-03 10:38:40 +03:00
illiliti c9b824bd54 udev_monitor.c: skip inotify event if directory 2021-06-03 09:41:26 +03:00
illiliti fb44266bfd udev_monitor.c: check poll error early 2021-06-03 09:37:13 +03:00
illiliti 37e5fa7206 udev_monitor.c: inotify read of size 0 is impossible 2021-06-03 09:30:46 +03:00
illiliti 32f9d14551 udev_monitor.c: fix bad return value in udev_monitor_enable_receiving 2021-06-03 09:24:55 +03:00
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