]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/device.c
Merge pull request #17732 from yuwata/core-use-synthetic_errno
[thirdparty/systemd.git] / src / core / device.c
index 9a1d88270d1de9aa41fd40d1aebeb5a13ed5e853..6440c59e26eeea965344b6f4a6a49a9a656126d9 100644 (file)
@@ -515,11 +515,10 @@ static int device_setup_unit(Manager *m, sd_device *dev, const char *path, bool
                 if (DEVICE(u)->state == DEVICE_PLUGGED &&
                     DEVICE(u)->sysfs &&
                     sysfs &&
-                    !path_equal(DEVICE(u)->sysfs, sysfs)) {
-                        log_unit_debug(u, "Device %s appeared twice with different sysfs paths %s and %s, ignoring the latter.",
-                                       e, DEVICE(u)->sysfs, sysfs);
-                        return -EEXIST;
-                }
+                    !path_equal(DEVICE(u)->sysfs, sysfs))
+                        return log_unit_debug_errno(u, SYNTHETIC_ERRNO(EEXIST),
+                                                    "Device %s appeared twice with different sysfs paths %s and %s, ignoring the latter.",
+                                                    e, DEVICE(u)->sysfs, sysfs);
 
                 delete = false;