summaryrefslogtreecommitdiff
path: root/src/core/path.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-09-11 19:49:33 +0200
committerLennart Poettering <lennart@poettering.net>2020-09-14 13:05:09 +0200
commit0377cd2936ae5cac0c9d76a4b58889f121c097c4 (patch)
tree12c1118cd02354e7ed6e92a514b74adfad0497f6 /src/core/path.c
parent415f8a5bfed4604e4a1bc275682d51af3ad3b611 (diff)
downloadsystemd-0377cd2936ae5cac0c9d76a4b58889f121c097c4.tar.gz
core: propagate triggered unit in more load states
In 4c2ef3276735ad9f7fccf33f5bdcbe7d8751e7ec we enabled propagating triggered unit state to the triggering unit for service units in more load states, so that we don't accidentally stop tracking state correctly. Do the same for our other triggering unit states: automounts, paths, and timers. Also, make this an assertion rather than a simple test. After all it should never happen that we get called for half-loaded units or units of the wrong type. The load routines should already have made this impossible.
Diffstat (limited to 'src/core/path.c')
-rw-r--r--src/core/path.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/path.c b/src/core/path.c
index 1c3c28e341..8ffec72ede 100644
--- a/src/core/path.c
+++ b/src/core/path.c
@@ -748,11 +748,10 @@ static void path_trigger_notify(Unit *u, Unit *other) {
assert(u);
assert(other);
- /* Invoked whenever the unit we trigger changes state or gains
- * or loses a job */
+ /* Invoked whenever the unit we trigger changes state or gains or loses a job */
- if (other->load_state != UNIT_LOADED)
- return;
+ /* Filter out invocations with bogus state */
+ assert(UNIT_IS_LOAD_COMPLETE(other->load_state));
if (p->state == PATH_RUNNING &&
UNIT_IS_INACTIVE_OR_FAILED(unit_active_state(other))) {