]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pid1: make return value of device_remove_old() void too
authorLennart Poettering <lennart@poettering.net>
Wed, 2 Jun 2021 08:36:53 +0000 (10:36 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 3 Jun 2021 13:01:05 +0000 (15:01 +0200)
src/core/device.c

index 84898d7236301b7f77720ba0ede0d528774f1abb..d188b0cd2227b3c1ba91ea82e80b030741e82685 100644 (file)
@@ -889,27 +889,24 @@ static void device_propagate_reload_by_sysfs(Manager *m, const char *sysfs) {
         }
 }
 
-static int device_remove_old(Manager *m, sd_device *dev) {
+static void device_remove_old_on_move(Manager *m, sd_device *dev) {
         _cleanup_free_ char *syspath_old = NULL, *e = NULL;
         const char *devpath_old;
         int r;
 
         r = sd_device_get_property_value(dev, "DEVPATH_OLD", &devpath_old);
-        if (r < 0) {
-                log_device_debug_errno(dev, r, "Failed to get DEVPATH_OLD= property on 'move' uevent, ignoring: %m");
-                return 0;
-        }
+        if (r < 0)
+                return (void) log_device_debug_errno(dev, r, "Failed to get DEVPATH_OLD= property on 'move' uevent, ignoring: %m");
 
         syspath_old = path_join("/sys", devpath_old);
         if (!syspath_old)
-                return log_oom();
+                return (void) log_oom();
 
         r = unit_name_from_path(syspath_old, ".device", &e);
         if (r < 0)
-                return log_device_error_errno(dev, r, "Failed to generate unit name from old device path: %m");
+                return (void) log_device_error_errno(dev, r, "Failed to generate unit name from old device path: %m");
 
         device_update_found_by_sysfs(m, syspath_old, 0, DEVICE_FOUND_UDEV|DEVICE_FOUND_MOUNT|DEVICE_FOUND_SWAP);
-        return 0;
 }
 
 static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void *userdata) {
@@ -937,7 +934,7 @@ static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void *
                 device_propagate_reload_by_sysfs(m, sysfs);
 
         if (action == SD_DEVICE_MOVE)
-                (void) device_remove_old(m, dev);
+                device_remove_old_on_move(m, dev);
 
         /* A change event can signal that a device is becoming ready, in particular if the device is using
          * the SYSTEMD_READY logic in udev so we need to reach the else block of the following if, even for