summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2015-02-18 14:22:37 -0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-02-26 09:38:50 -0500
commit03455c2879699852b691903343e378c28992ff6a (patch)
treed7e7eaed8fc3ec9528e20d57f54c400b2dbb484a /src/core/unit.c
parente342b74468870f2e4f3e15f7277a0adea42183ca (diff)
core: emit changes for NFailedUnits property
By notifying the clients when this property is changed it's possible to allow "system health monitor" tools to get transitions like running<->degraded. This is an alternative to send changes on the SystemState property since the latter is more difficult to derive.
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))