chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b065047
)
unit: issue notify even if the high-level state didn't change
author
Lennart Poettering
<lennart@poettering.net>
Sat, 10 Apr 2010 02:45:44 +0000
(
04:45
+0200)
committer
Lennart Poettering
<lennart@poettering.net>
Sat, 10 Apr 2010 16:00:20 +0000
(18:00 +0200)
unit.c
patch
|
blob
|
history
diff --git
a/unit.c
b/unit.c
index bea96a21cbbc40b45c7a0bf61777b55fc0722330..6406015b4bc075cf9855ff222f4fe0bfa9c19533 100644
(file)
--- 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));
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);
if (!UNIT_IS_ACTIVE_OR_RELOADING(os) && UNIT_IS_ACTIVE_OR_RELOADING(ns))
u->meta.active_enter_timestamp = now(CLOCK_REALTIME);