Zbigniew Jędrzejewski-Szmek
527ead383d
libudev: drop unnecessary check
...
sd_device_get_subsystem returns -ENOENT if subsystem is not set.
2018-11-23 09:16:11 +01:00
Yu Watanabe
3f14e7217a
libudev: do not ignore error in udev_list_entry_add()
2018-11-22 23:50:02 +09:00
Yu Watanabe
fd05c424c0
libudev: introduce return_with_errno() and use it where applicable
2018-11-22 23:49:55 +09:00
Yu Watanabe
f349626bed
libudev-list: drop unused udev argument from udev_list_init()
2018-11-22 23:19:25 +09:00
Yu Watanabe
876affad43
libudev-list: drop unused private functions
2018-11-22 23:19:17 +09:00
Yu Watanabe
3839535a53
libudev: make util_resolve_subsys_kernel() return negative errno
...
This also replaces udev_device by sd_device in the function.
2018-11-21 17:31:16 +09:00
Yu Watanabe
df8ba4fa0e
libudev-util: make util_replace_whitespace() not count leading white spaces
2018-11-21 17:30:45 +09:00
Yu Watanabe
646acebd58
libudev-util: make util_replace_*() return size_t
2018-11-21 16:35:20 +09:00
Yu Watanabe
805a7097ee
libudev-util: add assertions
2018-11-21 16:32:54 +09:00
Yu Watanabe
f921b457a7
libudev: coding style fixes
2018-11-20 14:38:35 +09:00
Yu Watanabe
5ea78a39e5
libudev-list: move libudev-list related definitions to libudev-list-internal.h
...
This also rename libudev-private.h to libudev-util.h, and cleanups
several unnecessary headers from udev.h and libudev-util.h
2018-11-20 14:38:35 +09:00
Yu Watanabe
170e4380b6
libudev: drop prototypes for nonexistent functions
2018-11-20 14:38:35 +09:00
Yu Watanabe
c84954e8ed
libudev-monitor: drop unused private functions
2018-11-20 14:38:35 +09:00
Yu Watanabe
53369277ec
libudev-device: drop unused private functions
2018-11-20 14:38:35 +09:00
Yu Watanabe
02edd80d87
udev: move definition of READ_END and WRITE_END from libudev-private.h to udev.h
2018-11-20 14:38:35 +09:00
Lennart Poettering
012c2f761b
tree-wide: use __ prefixed gcc attributes ( #10843 )
...
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. "
2018-11-20 12:34:08 +09:00
Yu Watanabe
46f0fbd8fd
udev: drop util_log_priority() and use log_level_from_string()
...
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'.
2018-11-12 23:25:40 +09:00
Yu Watanabe
8ecbc4b880
libudev: conserve previous behavior
...
The commit dcfbde3a43
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 .
2018-11-12 13:00:30 +09:00
Yu Watanabe
5a937ea2f6
sd-device: make sd_device_get_is_initialized() returns is_initialized by return value
2018-10-29 17:33:33 +09:00
Yu Watanabe
14cb109d45
tree-wide: replace 'unsigned int' with 'unsigned'
2018-10-19 22:19:12 +02:00
Yu Watanabe
e39b4d254d
libudev: re-implement udev-monitor by sd_device_monitor
2018-10-17 03:31:20 +09:00
Lennart Poettering
6d5e65f645
tree-wide: add a single version of "static const int one = 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.
2018-10-15 19:40:51 +02:00
Yu Watanabe
dcfbde3a43
sd-device: make sd_device_get_*() return -ENOENT if the values are not set
2018-09-23 17:18:19 +09:00
Zbigniew Jędrzejewski-Szmek
32397af3d4
Merge pull request #9928 from yuwata/libudev-cleanups
...
libudev: coding style updates
2018-09-15 22:36:38 +02:00
Yu Watanabe
8aae9a66fa
sd-device,libudev: make an argument for *_set_sysattr_value() const
2018-09-11 12:45:21 +09:00
Yu Watanabe
7f9e03952a
libudev-monitor: use assert_return() in many places
2018-09-11 12:45:21 +09:00
Yu Watanabe
e38242b03a
libudev-monitor: add missing error checks in udev_monitor_enable_receiving()
2018-09-11 12:45:21 +09:00
Yu Watanabe
a9808d8445
libudev-monitor: introduce udev_monitor_send_sd_device()
...
And use it in udev_monitor_send_device().
2018-09-11 12:45:21 +09:00
Yu Watanabe
23c457a7fb
libudev-monitor: re-implement udev_monitor_receive_sd_device()
2018-09-11 12:45:21 +09:00
Yu Watanabe
759d9f3f8d
libudev-monitor: use Hashmap or Set to store filters
2018-09-11 12:45:21 +09:00
Yu Watanabe
5e1e4c247b
libudev-monitor: use structured initializer
2018-09-11 12:45:21 +09:00
Yu Watanabe
a062a72f1b
libudev-monitor: rename monitor_set_nl_address() and make it return negative errno
2018-09-11 12:45:21 +09:00
Yu Watanabe
be1791ad6a
libudev-monitor: rename udev_has_devtmpfs() and move it to mount-util.c
...
As the function itself is quite generic.
2018-09-11 12:45:21 +09:00
Yu Watanabe
3d01fa902c
libudev-monitor: use structured initializer in bpf_*()
...
This also drop inline attribute from the functions.
2018-09-11 12:45:21 +09:00
Yu Watanabe
7f79720711
libudev-monitor: use 'unsigned' instead of 'unsigned int'
2018-09-11 12:45:21 +09:00
Yu Watanabe
02e7ae2fdc
libudev-device: create sd_device at first in udev_device_new_from_*()
2018-09-11 12:45:21 +09:00
Yu Watanabe
a7e9db150b
libudev-device: drop prototypes of unexistent functions
2018-09-11 12:45:21 +09:00
Yu Watanabe
536cbd7fa6
libudev: drop a prototype of unexistent function
2018-09-11 12:45:21 +09:00
Yu Watanabe
76387b9abb
libudev-device: coding style fixes
2018-09-11 12:45:21 +09:00
Yu Watanabe
33a03e6eff
libudev-device: fix return value of udev_device_has_tag()
2018-09-11 12:45:21 +09:00
Yu Watanabe
1b6374d285
libudev-device: use original negative errno
2018-09-11 12:45:21 +09:00
Yu Watanabe
71074e3a10
libudev-device: use structured initializer
2018-09-11 12:45:21 +09:00
Yu Watanabe
60fdee32bd
libudev-enumerate: use structured initializer
2018-09-11 12:45:21 +09:00
Yu Watanabe
2b19953a0d
libudev-hwdb: use assert_return_errno()
2018-09-11 12:45:21 +09:00
Yu Watanabe
68b80b8557
libudev-hwdb: use structured initializer
2018-09-11 12:45:21 +09:00
Yu Watanabe
b485aa5852
libudev-hwdb: drop unused 'struct udev *udev' in udev_hwdb struct
2018-09-11 12:45:21 +09:00
Yu Watanabe
f8cdabc0ec
libudev-queue: coding style fixes
2018-09-11 12:45:21 +09:00
Yu Watanabe
09f638ebd9
libudev-queue: drop prototypes of nonexistent functions
2018-09-11 12:45:21 +09:00
Yu Watanabe
2dac88a9d1
libudev-queue: use _cleanup_ attribute and TAKE_FD()
2018-09-11 12:45:21 +09:00
Yu Watanabe
d35c0e8d53
libudev-queue: use assert_return()
2018-09-11 12:45:21 +09:00