core: unify code for checking whether unit to trigger is loaded
This commit is contained in:
+3
-6
@@ -555,17 +555,14 @@ static void path_mkdir(Path *p) {
|
||||
|
||||
static int path_start(Unit *u) {
|
||||
Path *p = PATH(u);
|
||||
Unit *trigger;
|
||||
int r;
|
||||
|
||||
assert(p);
|
||||
assert(IN_SET(p->state, PATH_DEAD, PATH_FAILED));
|
||||
|
||||
trigger = UNIT_TRIGGER(u);
|
||||
if (!trigger || trigger->load_state != UNIT_LOADED) {
|
||||
log_unit_error(u, "Refusing to start, unit to trigger not loaded.");
|
||||
return -ENOENT;
|
||||
}
|
||||
r = unit_test_trigger_loaded(u);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = unit_test_start_limit(u);
|
||||
if (r < 0) {
|
||||
|
||||
Reference in New Issue
Block a user