summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-10 04:45:44 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-10 18:00:20 +0200
commit8e471ccd1583371cab19a6263b8952b37d069b07 (patch)
treec587725220ef4e35ba2a68c35a16395efa228952
parentb065047527a0fa951c9864a5fea7dce2a5844f2d (diff)
unit: issue notify even if the high-level state didn't change
-rw-r--r--unit.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/unit.c b/unit.c
index bea96a21cb..6406015b4b 100644
--- a/unit.c
+++ b/unit.c
@@ -856,8 +856,12 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns) {
assert(!(os == UNIT_ACTIVE && ns == UNIT_ACTIVATING));
assert(!(os == UNIT_INACTIVE && ns == UNIT_DEACTIVATING));
- if (os == ns)
- return;
+ /* Note that this is called for all low-level state changes,
+ * even if they might map to the same high-level
+ * UnitActiveState! That means that ns == os is OK an expected
+ * behaviour here. For example: if a mount point is remounted
+ * this function will be called too and the utmp code below
+ * relies on that! */
if (!UNIT_IS_ACTIVE_OR_RELOADING(os) && UNIT_IS_ACTIVE_OR_RELOADING(ns))
u->meta.active_enter_timestamp = now(CLOCK_REALTIME);