util: introduce device_is_renaming()

It will be used in the later commit.
This commit is contained in:
Yu Watanabe
2019-03-05 10:33:41 +09:00
parent 30de2b89d1
commit 90ba130f00
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -169,3 +169,15 @@ int device_wait_for_initialization(sd_device *device, const char *subsystem, sd_
*ret = TAKE_PTR(data.device);
return 0;
}
int device_is_renaming(sd_device *dev) {
int r;
assert(dev);
r = sd_device_get_property_value(dev, "ID_RENAMING", NULL);
if (r < 0 && r != -ENOENT)
return r;
return r >= 0;
}
+1
View File
@@ -27,3 +27,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);