core: improve finding OnSuccess=/OnFailure= dependent (#35468)

Previously if one service specified the same unit as their
success and failure handler we bailed out of resolving the triggering unit
even though it is still unique.
This commit is contained in:
Nils K
2024-12-10 20:48:09 +01:00
committed by GitHub
parent e82677aa07
commit e76d83d100
2 changed files with 24 additions and 15 deletions
+1 -7
View File
@@ -1648,13 +1648,7 @@ static Service *service_get_triggering_service(Service *s) {
* or OnSuccess= then we return NULL. This is since we don't know from which
* one to propagate the exit status. */
UNIT_FOREACH_DEPENDENCY(other, UNIT(s), UNIT_ATOM_ON_FAILURE_OF) {
if (candidate)
goto have_other;
candidate = other;
}
UNIT_FOREACH_DEPENDENCY(other, UNIT(s), UNIT_ATOM_ON_SUCCESS_OF) {
UNIT_FOREACH_DEPENDENCY(other, UNIT(s), UNIT_ATOM_ON_SUCCESS_OF|UNIT_ATOM_ON_FAILURE_OF) {
if (candidate)
goto have_other;
candidate = other;