summaryrefslogtreecommitdiff
path: root/src/core/unit-dependency-atom.c
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2022-02-09 11:48:30 +0000
committerLuca Boccassi <bluca@debian.org>2022-03-10 14:43:14 +0000
commit95c81c55b2eb6063d79ad343738a6240bbccd100 (patch)
tree36d16e4ba22f12c9e8e85f6773c8f53823623ecc /src/core/unit-dependency-atom.c
parentbd844eae233b74ebf151ceefa0a5f026978bebab (diff)
downloadsystemd-95c81c55b2eb6063d79ad343738a6240bbccd100.tar.gz
core: split $MONITOR_METADATA and return it only if a single unit triggers OnFailure/OnSuccess
Remove the list logic, and simply skip passing metadata if more than one unit triggered an OnFailure/OnSuccess handler. Instead of a single env var to loop over, provide each separate item as its own variable. Fixes https://github.com/systemd/systemd/issues/22370
Diffstat (limited to 'src/core/unit-dependency-atom.c')
-rw-r--r--src/core/unit-dependency-atom.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/core/unit-dependency-atom.c b/src/core/unit-dependency-atom.c
index 333eea6c3d..81333523e7 100644
--- a/src/core/unit-dependency-atom.c
+++ b/src/core/unit-dependency-atom.c
@@ -82,13 +82,11 @@ static const UnitDependencyAtom atom_map[_UNIT_DEPENDENCY_MAX] = {
[UNIT_PROPAGATES_STOP_TO] = UNIT_ATOM_RETROACTIVE_STOP_ON_STOP |
UNIT_ATOM_PROPAGATE_STOP,
- [UNIT_ON_FAILURE] = UNIT_ATOM_ON_FAILURE |
- UNIT_ATOM_BACK_REFERENCE_IMPLIED,
-
- [UNIT_ON_SUCCESS] = UNIT_ATOM_ON_SUCCESS |
- UNIT_ATOM_BACK_REFERENCE_IMPLIED,
-
/* These are simple dependency types: they consist of a single atom only */
+ [UNIT_ON_FAILURE] = UNIT_ATOM_ON_FAILURE,
+ [UNIT_ON_SUCCESS] = UNIT_ATOM_ON_SUCCESS,
+ [UNIT_ON_FAILURE_OF] = UNIT_ATOM_ON_FAILURE_OF,
+ [UNIT_ON_SUCCESS_OF] = UNIT_ATOM_ON_SUCCESS_OF,
[UNIT_BEFORE] = UNIT_ATOM_BEFORE,
[UNIT_AFTER] = UNIT_ATOM_AFTER,
[UNIT_TRIGGERS] = UNIT_ATOM_TRIGGERS,
@@ -104,8 +102,6 @@ static const UnitDependencyAtom atom_map[_UNIT_DEPENDENCY_MAX] = {
* things discoverable/debuggable as they are the inverse dependencies to some of the above. As they
* have no effect of their own, they all map to no atoms at all, i.e. the value 0. */
[UNIT_RELOAD_PROPAGATED_FROM] = 0,
- [UNIT_ON_SUCCESS_OF] = 0,
- [UNIT_ON_FAILURE_OF] = 0,
[UNIT_STOP_PROPAGATED_FROM] = 0,
};
@@ -200,17 +196,19 @@ UnitDependency unit_dependency_from_unique_atom(UnitDependencyAtom atom) {
case UNIT_ATOM_PROPAGATE_STOP_FAILURE:
return UNIT_CONFLICTED_BY;
- case UNIT_ATOM_ON_FAILURE |
- UNIT_ATOM_BACK_REFERENCE_IMPLIED:
+ /* And now, the simple ones */
+
case UNIT_ATOM_ON_FAILURE:
return UNIT_ON_FAILURE;
- case UNIT_ATOM_ON_SUCCESS |
- UNIT_ATOM_BACK_REFERENCE_IMPLIED:
case UNIT_ATOM_ON_SUCCESS:
return UNIT_ON_SUCCESS;
- /* And now, the simple ones */
+ case UNIT_ATOM_ON_SUCCESS_OF:
+ return UNIT_ON_SUCCESS_OF;
+
+ case UNIT_ATOM_ON_FAILURE_OF:
+ return UNIT_ON_FAILURE_OF;
case UNIT_ATOM_BEFORE:
return UNIT_BEFORE;