diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-02-10 22:15:01 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-02-18 18:20:56 +0100 |
commit | a11300221482da7ffe7be2d75d508ddd411814f6 (patch) | |
tree | 009163435be6a2878d026e70439d731a1587a6e9 /src/libudev | |
parent | 96fb82aa06f2edef153c0ecb1642783aac1c1c84 (diff) | |
download | systemd-a11300221482da7ffe7be2d75d508ddd411814f6.tar.gz |
sd-device: add sd_device_get_action() + sd_device_get_seqnum() + sd_device_new_from_stat_rdev()
To make sd-device properly usable for all programs we need to provide an
API for the "action" field of an event, it's one of the most relevant
ones, and it was so far missing.
This also adds sd_device_get_seqnum(), which isn't that interesting,
except for generating pretty debug output, which we use it ourselves
for.
This also makes device_new_from_stat_rdev() public, as it is truly
useful, as we can see in our own uses of it, and I think is fairly
generic to show up in the public APIs.
Diffstat (limited to 'src/libudev')
-rw-r--r-- | src/libudev/libudev-device.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c index 34543a8b2e..67f4b48da1 100644 --- a/src/libudev/libudev-device.c +++ b/src/libudev/libudev-device.c @@ -82,7 +82,7 @@ _public_ unsigned long long udev_device_get_seqnum(struct udev_device *udev_devi assert_return_errno(udev_device, 0, EINVAL); - if (device_get_seqnum(udev_device->device, &seqnum) < 0) + if (sd_device_get_seqnum(udev_device->device, &seqnum) < 0) return 0; return seqnum; @@ -693,11 +693,11 @@ _public_ struct udev_list_entry *udev_device_get_properties_list_entry(struct ud * Returns: the kernel action value, or #NULL if there is no action value available. **/ _public_ const char *udev_device_get_action(struct udev_device *udev_device) { - DeviceAction action; + sd_device_action_t action; assert_return_errno(udev_device, NULL, EINVAL); - if (device_get_action(udev_device->device, &action) < 0) + if (sd_device_get_action(udev_device->device, &action) < 0) return NULL; return device_action_to_string(action); |