]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pid1: properly propagate errors from device_setup_unit()
authorLennart Poettering <lennart@poettering.net>
Wed, 2 Jun 2021 13:31:50 +0000 (15:31 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 3 Jun 2021 13:01:05 +0000 (15:01 +0200)
We want to propagate errors here, since we want to make dependent on the
success of creating the main device unit the creation of the auxiliary
device units. Thus if we suppress errors here we might end up in exotic
corner cases in a situation were we create the auxiliary ("following")
device units without the primary one.

src/core/device.c

index 03a2a9f22a2ddca9f9277e40ea0d607eead996b1..62a987dea7a7e70be1242444823dc34199ca4e72 100644 (file)
@@ -493,10 +493,8 @@ static int device_setup_unit(Manager *m, sd_device *dev, const char *path, bool
 
         if (dev) {
                 r = sd_device_get_syspath(dev, &sysfs);
-                if (r < 0) {
-                        log_device_debug_errno(dev, r, "Couldn't get syspath from device, ignoring: %m");
-                        return 0;
-                }
+                if (r < 0)
+                        return log_device_debug_errno(dev, r, "Couldn't get syspath from device, ignoring: %m");
         }
 
         r = unit_name_from_path(path, ".device", &e);