summaryrefslogtreecommitdiffstats
path: root/src/core/path.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-03-18 12:29:08 +0100
committerLennart Poettering <lennart@poettering.net>2019-03-18 16:06:36 +0100
commita4191c9fb5fc473f8e4d1d32fec08efd8a2217d4 (patch)
tree1a762bb20e5739cd5525fb0ebfecb66b5c19fe41 /src/core/path.c
parentcore: rename unit_{start_limit|condition|assert}_test() to unit_test_xyz() (diff)
downloadsystemd-a4191c9fb5fc473f8e4d1d32fec08efd8a2217d4.tar.xz
systemd-a4191c9fb5fc473f8e4d1d32fec08efd8a2217d4.zip
core: unify code for checking whether unit to trigger is loaded
Diffstat (limited to 'src/core/path.c')
-rw-r--r--src/core/path.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/path.c b/src/core/path.c
index a7a7ec28ae..3fe14ef2bc 100644
--- a/src/core/path.c
+++ b/src/core/path.c
@@ -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) {