summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/unit.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 6c130d4cd1..ae019c7f7e 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2890,7 +2890,7 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) {
}
int unit_coldplug(Unit *u) {
- int r;
+ int r = 0, q = 0;
assert(u);
@@ -2901,17 +2901,16 @@ int unit_coldplug(Unit *u) {
u->coldplugged = true;
- if (UNIT_VTABLE(u)->coldplug) {
+ if (UNIT_VTABLE(u)->coldplug)
r = UNIT_VTABLE(u)->coldplug(u);
- if (r < 0)
- return r;
- }
- if (u->job) {
- r = job_coldplug(u->job);
- if (r < 0)
- return r;
- }
+ if (u->job)
+ q = job_coldplug(u->job);
+
+ if (r < 0)
+ return r;
+ if (q < 0)
+ return q;
return 0;
}