1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-08 08:58:27 +03:00

sd-device: reduce indentation

This commit is contained in:
Yu Watanabe 2022-04-17 13:11:08 +09:00
parent ff58f2ae2a
commit f5a75f2027

View File

@ -774,19 +774,17 @@ int device_rename(sd_device *device, const char *name) {
return r;
r = sd_device_get_property_value(device, "INTERFACE", &interface);
if (r >= 0) {
/* like DEVPATH_OLD, INTERFACE_OLD is not saved to the db, but only stays around for the current event */
r = device_add_property_internal(device, "INTERFACE_OLD", interface);
if (r < 0)
return r;
r = device_add_property_internal(device, "INTERFACE", name);
if (r < 0)
return r;
} else if (r != -ENOENT)
if (r == -ENOENT)
return 0;
if (r < 0)
return r;
return 0;
/* like DEVPATH_OLD, INTERFACE_OLD is not saved to the db, but only stays around for the current event */
r = device_add_property_internal(device, "INTERFACE_OLD", interface);
if (r < 0)
return r;
return device_add_property_internal(device, "INTERFACE", name);
}
int device_shallow_clone(sd_device *old_device, sd_device **new_device) {