]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device: reduce indentation
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 Apr 2022 04:11:08 +0000 (13:11 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 Apr 2022 19:34:14 +0000 (04:34 +0900)
src/libsystemd/sd-device/device-private.c

index 90dcd3a857f9b9ece1829864a1fab04839c421af..9bf39ecfab259833ff355c67f3193a6ba623982b 100644 (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;
+        if (r == -ENOENT)
+                return 0;
+        if (r < 0)
+                return r;
 
-                r = device_add_property_internal(device, "INTERFACE", name);
-                if (r < 0)
-                        return r;
-        } else if (r != -ENOENT)
+        /* 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 0;
+        return device_add_property_internal(device, "INTERFACE", name);
 }
 
 int device_shallow_clone(sd_device *old_device, sd_device **new_device) {