summaryrefslogtreecommitdiffstats
path: root/src/core/device.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-06-02 15:31:50 +0200
committerLennart Poettering <lennart@poettering.net>2021-06-03 15:01:05 +0200
commit9951c8df1e8c10fb97e3509f3adafaf5585c9fcb (patch)
treed318ce5fb47fd14d4e6aedb772afe7157d96392e /src/core/device.c
parentpid1: reduce log noise generated by devices with overly long sysfs paths (diff)
downloadsystemd-9951c8df1e8c10fb97e3509f3adafaf5585c9fcb.tar.xz
systemd-9951c8df1e8c10fb97e3509f3adafaf5585c9fcb.zip
pid1: properly propagate errors from device_setup_unit()
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.
Diffstat (limited to 'src/core/device.c')
-rw-r--r--src/core/device.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/device.c b/src/core/device.c
index 03a2a9f22a..62a987dea7 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -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);