diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-03-12 13:17:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-12 13:17:33 +0100 |
commit | ec637f309f619a9a8a3a31c1b170511ff4921a71 (patch) | |
tree | d187bab1f59ea004b5c5d76c09b2b4b4fcfc4f16 /src/shared | |
parent | ca66b69d5bdc9d3bf34cdc53bb600f88ef6a2c87 (diff) | |
parent | 7905e6d70e2e0224dc7b604747f962d543190f0e (diff) | |
download | systemd-ec637f309f619a9a8a3a31c1b170511ff4921a71.tar.gz |
Merge pull request #11943 from yuwata/device-action-seqnum-cleanups
sd-device: store parsed SEQNUM and ACTION string
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/udev-util.c | 11 | ||||
-rw-r--r-- | src/shared/udev-util.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/shared/udev-util.c b/src/shared/udev-util.c index 6847d715f6..19d823c11d 100644 --- a/src/shared/udev-util.c +++ b/src/shared/udev-util.c @@ -181,3 +181,14 @@ int device_is_renaming(sd_device *dev) { return r >= 0; } + +bool device_for_action(sd_device *dev, DeviceAction action) { + DeviceAction a; + + assert(dev); + + if (device_get_action(dev, &a) < 0) + return false; + + return a == action; +} diff --git a/src/shared/udev-util.h b/src/shared/udev-util.h index c45d6a11fd..3c45447515 100644 --- a/src/shared/udev-util.h +++ b/src/shared/udev-util.h @@ -3,6 +3,7 @@ #include "sd-device.h" +#include "device-private.h" #include "time-util.h" typedef enum ResolveNameTiming { @@ -28,3 +29,4 @@ static inline int udev_parse_config(void) { int device_wait_for_initialization(sd_device *device, const char *subsystem, sd_device **ret); int device_is_renaming(sd_device *dev); +bool device_for_action(sd_device *dev, DeviceAction action); |