diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-03-18 12:29:08 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-03-18 16:06:36 +0100 |
commit | a4191c9fb5fc473f8e4d1d32fec08efd8a2217d4 (patch) | |
tree | 1a762bb20e5739cd5525fb0ebfecb66b5c19fe41 /src/core/automount.c | |
parent | 97a3f4ee052e1b8a0ff03accfa478e352891a84f (diff) | |
download | systemd-a4191c9fb5fc473f8e4d1d32fec08efd8a2217d4.tar.gz |
core: unify code for checking whether unit to trigger is loaded
Diffstat (limited to 'src/core/automount.c')
-rw-r--r-- | src/core/automount.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/automount.c b/src/core/automount.c index eff357bb3d..8ffdad18c7 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -796,7 +796,6 @@ fail: static int automount_start(Unit *u) { Automount *a = AUTOMOUNT(u); - Unit *trigger; int r; assert(a); @@ -807,11 +806,9 @@ static int automount_start(Unit *u) { return -EEXIST; } - 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) { |