sd-device: move copy_all_tags() from udev
No functional change, preparation for the next commit.
This commit is contained in:
+1
-18
@@ -329,23 +329,6 @@ static int event_execute_rules_on_remove(UdevEvent *event, UdevRules *rules) {
|
||||
return r;
|
||||
}
|
||||
|
||||
static int copy_all_tags(sd_device *d, sd_device *s) {
|
||||
int r;
|
||||
|
||||
assert(d);
|
||||
|
||||
if (!s)
|
||||
return 0;
|
||||
|
||||
FOREACH_DEVICE_TAG(s, tag) {
|
||||
r = device_add_tag(d, tag, false);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int update_clone(UdevEvent *event) {
|
||||
sd_device *dev = ASSERT_PTR(ASSERT_PTR(event)->dev_db_clone);
|
||||
int r;
|
||||
@@ -398,7 +381,7 @@ int udev_event_execute_rules(UdevEvent *event, UdevRules *rules) {
|
||||
if (r < 0)
|
||||
return log_device_debug_errno(dev, r, "Failed to clone sd_device object: %m");
|
||||
|
||||
r = copy_all_tags(dev, event->dev_db_clone);
|
||||
r = device_copy_all_tags(dev, event->dev_db_clone);
|
||||
if (r < 0)
|
||||
log_device_warning_errno(dev, r, "Failed to copy all tags from old database entry, ignoring: %m");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user