summaryrefslogtreecommitdiff
path: root/src/libudev
Commit message (Collapse)AuthorAgeFilesLines
...
* tree-wide: port to fd_wait_for_event()Lennart Poettering2020-06-101-13/+6
| | | | | | | | Prompted by the discussion on #16110, let's migrate more code to fd_wait_for_event(). This only leaves 7 places where we call into poll()/poll() directly in our entire codebase. (one of which is fd_wait_for_event() itself)
* tree-wide: check POLLNVAL everywhereLennart Poettering2020-06-101-1/+4
| | | | | | | | | | | | | poll() sets POLLNVAL inside of the poll structures if an invalid fd is passed. So far we generally didn't check for that, thus not taking notice of the error. Given that this specific kind of error is generally indication of a programming error, and given that our code is embedded into our projects via NSS or because people link against our library, let's explicitly check for this and convert it to EBADF. (I ran into a busy loop because of this missing check when some of my test code accidentally closed an fd it shouldn't close, so this is a real thing)
* tree-wide: fix spelling errorsFrantisek Sumsal2020-04-211-1/+1
| | | | | | Based on a report from Fossies.org using Codespell. Followup to #15436
* tree-wide: drop string.h when string-util.h or friends are includedYu Watanabe2019-11-041-1/+0
|
* tree-wide: drop missing.hYu Watanabe2019-10-311-1/+0
|
* libudev: Update list of possible actionsBastien Nocera2019-07-241-2/+2
| | | | Add "move" action as per src/libsystemd/sd-device/device-private.c
* libudev: hide definition of struct udev_deviceYu Watanabe2019-06-123-32/+41
|
* libudev: rescan devices when filter is updatedYu Watanabe2019-06-121-9/+73
| | | | Fixes #12776.
* libudev: re-implement libudev-list with LIST and hashmapYu Watanabe2019-06-121-193/+105
|
* libudev: hide definition of struct udev_list from other libudev componentsYu Watanabe2019-06-126-55/+101
| | | | | In the later commit, udev_list will be just a wrapper of hashmap or LIST. So, allocating udev_list does not increase much cost.
* libudev: drop unused variableYu Watanabe2019-06-121-1/+0
|
* codespell: fix spelling errorsBen Boeckel2019-04-291-1/+1
|
* util: split out memcmp()/memset() related calls into memory-util.[ch]Lennart Poettering2019-03-131-1/+1
| | | | Just some source rearranging.
* libudev: use device_get_seqnum() and device_get_action()Yu Watanabe2019-03-121-20/+7
|
* basic/utf8: do not read past end of string when looking for a multi-byte ↵Zbigniew Jędrzejewski-Szmek2019-02-261-1/+1
| | | | | | character Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9341.
* sd-device-enumerator: support multiple parentsYu Watanabe2019-01-231-3/+0
| | | | | | | | | | | When sd_device_enumerator_add_match_parent() is called multiple times, then previously set parents are discarded. This adds device_enumerator_add_match_parent_incremental() to make sd-device-enumerator scan devices under all specified parents. Note that for backward compatibility, sd_device_enumerator_add_match_parent() and udev_enumerate_add_match_parent() still discard previous assignments.
* Remove 'inline' attributes from static functions in .c files (#11426)Topi Miettinen2019-01-151-1/+1
| | | Let the compiler perform inlining (see #11397).
* libudev-util: make util_replace_whitespace() read only len charactersYu Watanabe2019-01-031-6/+7
| | | | | | This effectively reverts df8ba4fa0e8be1ff7899d08a4b6be0196c8405a0. Fixes #11264.
* meson: simplify handling of pkgconfigdatadir=no, pkgconfiglibdir=noZbigniew Jędrzejewski-Szmek2018-12-211-4/+3
| | | | | | | | | | | The idea was that those vars could be configured to 'no' to not install the .pc files, or they could be set to '', and then they would be built but not installed. This was inherited from the autoconf build system. This couldn't work because '' is replaced by the default value. Also, having this level of control doesn't seem necessary, since creating those files is very quick. Skipping with 'no' was implemented only for systemd.pc and not the other .pc files. Let's simplify things and skip installation if the target dir is configured as 'no' for all .pc files.
* meson: define PROJECT_VERSION as the "bare" project versionZbigniew Jędrzejewski-Szmek2018-12-201-1/+1
| | | | | | | | | | | | | | Let's not use atoi() if we can simply provide the project version as a number. In C code, this is the numerical project version. In substitutions in other files, this is just the bare substitution. The "PACKAGE_" prefix is from autotools, and is strange. We call systemd a "project", and "package" is something that distros build. Let's rename. PACKAGE_URL is renamed to PROJECT_URL for the same reasons and for consistency. (This leave PACKAGE_VERSION as the stringified define for C code.)
* libudev: drop unnecessary checkZbigniew Jędrzejewski-Szmek2018-11-231-2/+0
| | | | sd_device_get_subsystem returns -ENOENT if subsystem is not set.
* libudev: do not ignore error in udev_list_entry_add()Yu Watanabe2018-11-222-5/+10
|
* libudev: introduce return_with_errno() and use it where applicableYu Watanabe2018-11-226-160/+88
|
* libudev-list: drop unused udev argument from udev_list_init()Yu Watanabe2018-11-225-10/+8
|
* libudev-list: drop unused private functionsYu Watanabe2018-11-222-14/+0
|
* libudev: make util_resolve_subsys_kernel() return negative errnoYu Watanabe2018-11-212-30/+27
| | | | This also replaces udev_device by sd_device in the function.
* libudev-util: make util_replace_whitespace() not count leading white spacesYu Watanabe2018-11-211-20/+17
|
* libudev-util: make util_replace_*() return size_tYu Watanabe2018-11-212-6/+5
|
* libudev-util: add assertionsYu Watanabe2018-11-211-0/+8
|
* libudev: coding style fixesYu Watanabe2018-11-205-17/+17
|
* libudev-list: move libudev-list related definitions to libudev-list-internal.hYu Watanabe2018-11-2012-126/+90
| | | | | This also rename libudev-private.h to libudev-util.h, and cleanups several unnecessary headers from udev.h and libudev-util.h
* libudev: drop prototypes for nonexistent functionsYu Watanabe2018-11-201-2/+0
|
* libudev-monitor: drop unused private functionsYu Watanabe2018-11-202-63/+25
|
* libudev-device: drop unused private functionsYu Watanabe2018-11-203-410/+0
|
* udev: move definition of READ_END and WRITE_END from libudev-private.h to udev.hYu Watanabe2018-11-201-3/+0
|
* tree-wide: use __ prefixed gcc attributes (#10843)Lennart Poettering2018-11-201-8/+8
| | | | | | | | | | As suggest here: https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute-Syntax "You may optionally specify attribute names with ‘__’ preceding and following the name. This allows you to use them in header files without being concerned about a possible macro of the same name. For example, you may use the attribute name __noreturn__ instead of noreturn. "
* udev: drop util_log_priority() and use log_level_from_string()Yu Watanabe2018-11-122-17/+0
| | | | | | The function util_log_priority() is almost same as log_level_from_string(). The difference between them is only that util_log_priority() accepts such that '3 hogehoge'.
* libudev: conserve previous behaviorYu Watanabe2018-11-121-0/+2
| | | | | | | | | The commit dcfbde3a43d632ff6e286c77e1081087eca59d8e changes sd_device_get_ifindex() returns -ENOENT instead of zero if the device does not have ifindex. Let's keep the original behavior of udev_device_get_ifindex(). Fixes #10699.
* sd-device: make sd_device_get_is_initialized() returns is_initialized by ↵Yu Watanabe2018-10-291-3/+3
| | | | return value
* tree-wide: replace 'unsigned int' with 'unsigned'Yu Watanabe2018-10-194-8/+8
|
* libudev: re-implement udev-monitor by sd_device_monitorYu Watanabe2018-10-172-561/+41
|
* tree-wide: add a single version of "static const int one = 1"Lennart Poettering2018-10-151-2/+1
| | | | | | | | | | All over the place we define local variables for the various sockopts that take a bool-like "int" value. Sometimes they are const, sometimes static, sometimes both, sometimes neither. Let's clean this up, introduce a common const variable "const_int_one" (as well as one matching "const_int_zero") and use it everywhere, all acorss the codebase.
* sd-device: make sd_device_get_*() return -ENOENT if the values are not setYu Watanabe2018-09-231-3/+6
|
* Merge pull request #9928 from yuwata/libudev-cleanupsZbigniew Jędrzejewski-Szmek2018-09-1510-722/+579
|\ | | | | libudev: coding style updates
| * sd-device,libudev: make an argument for *_set_sysattr_value() constYu Watanabe2018-09-112-2/+2
| |
| * libudev-monitor: use assert_return() in many placesYu Watanabe2018-09-111-14/+13
| |
| * libudev-monitor: add missing error checks in udev_monitor_enable_receiving()Yu Watanabe2018-09-111-15/+16
| |
| * libudev-monitor: introduce udev_monitor_send_sd_device()Yu Watanabe2018-09-111-22/+40
| | | | | | | | And use it in udev_monitor_send_device().
| * libudev-monitor: re-implement udev_monitor_receive_sd_device()Yu Watanabe2018-09-111-125/+118
| |
| * libudev-monitor: use Hashmap or Set to store filtersYu Watanabe2018-09-111-76/+114
| |