From 5a6158b6412100672e1cbddb22efdcc5101fed7f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 10 Nov 2015 20:38:30 +0100 Subject: core: try to continue if coldplugging of a unit fails --- src/core/unit.c | 19 +++++++++---------- 1 file 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; } -- cgit v1.2.3-54-g00ecf