mirror of
https://github.com/systemd/systemd.git
synced 2026-08-05 07:30:30 +00:00
sd-device: introduce device_has_devlink()
This commit is contained in:
@@ -32,6 +32,7 @@ void device_set_db_persist(sd_device *device);
|
||||
void device_set_devlink_priority(sd_device *device, int priority);
|
||||
int device_ensure_usec_initialized(sd_device *device, sd_device *device_old);
|
||||
int device_add_devlink(sd_device *device, const char *devlink);
|
||||
bool device_has_devlink(sd_device *device, const char *devlink);
|
||||
int device_add_property(sd_device *device, const char *property, const char *value);
|
||||
int device_add_tag(sd_device *device, const char *tag, bool both);
|
||||
void device_remove_tag(sd_device *device, const char *tag);
|
||||
|
||||
@@ -1205,6 +1205,13 @@ int device_add_devlink(sd_device *device, const char *devlink) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool device_has_devlink(sd_device *device, const char *devlink) {
|
||||
assert(device);
|
||||
assert(devlink);
|
||||
|
||||
return set_contains(device->devlinks, devlink);
|
||||
}
|
||||
|
||||
static int device_add_property_internal_from_string(sd_device *device, const char *str) {
|
||||
_cleanup_free_ char *key = NULL;
|
||||
char *value;
|
||||
|
||||
Reference in New Issue
Block a user