1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

udev-util: introduce device_is_processing() helper function

This commit is contained in:
Yu Watanabe 2024-01-03 04:34:54 +09:00
parent 1e7c8fe494
commit f30a47c45e
2 changed files with 13 additions and 0 deletions

View File

@ -239,6 +239,18 @@ int device_is_renaming(sd_device *dev) {
return r;
}
int device_is_processing(sd_device *dev) {
int r;
assert(dev);
r = device_get_property_bool(dev, "ID_PROCESSING");
if (r == -ENOENT)
return false; /* defaults to false */
return r;
}
bool device_for_action(sd_device *dev, sd_device_action_t a) {
sd_device_action_t b;

View File

@ -13,6 +13,7 @@ int udev_parse_config(void);
int device_wait_for_initialization(sd_device *device, const char *subsystem, usec_t timeout_usec, sd_device **ret);
int device_wait_for_devlink(const char *path, const char *subsystem, usec_t timeout_usec, sd_device **ret);
int device_is_renaming(sd_device *dev);
int device_is_processing(sd_device *dev);
bool device_for_action(sd_device *dev, sd_device_action_t action);