summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 590ca3555a..63ccd671da 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -516,7 +516,7 @@ void unit_free(Unit *u) {
free(u->cgroup_path);
}
- set_remove(u->manager->failed_units, u);
+ manager_update_failed_units(u->manager, u, false);
set_remove(u->manager->startup_units, u);
free(u->description);
@@ -1797,10 +1797,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
}
/* Keep track of failed units */
- if (ns == UNIT_FAILED)
- set_put(u->manager->failed_units, u);
- else
- set_remove(u->manager->failed_units, u);
+ manager_update_failed_units(u->manager, u, ns == UNIT_FAILED);
/* Make sure the cgroup is always removed when we become inactive */
if (UNIT_IS_INACTIVE_OR_FAILED(ns))