summaryrefslogtreecommitdiff
path: root/service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-08 03:01:05 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-08 03:01:05 +0200
commita90ebccc072efa17313fe68c737b3507247c37dd (patch)
treef469f3392e84991816b949d27d07a2f744379d16 /service.c
parent37d88da701d75a3893b262580dc59042147a9b89 (diff)
unit: shortcut unit_notify() early, if possible
Diffstat (limited to 'service.c')
-rw-r--r--service.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/service.c b/service.c
index 7ed9783f79..74d03dbe1d 100644
--- a/service.c
+++ b/service.c
@@ -968,6 +968,9 @@ static void service_set_state(Service *s, ServiceState state) {
state == SERVICE_AUTO_RESTART)
service_notify_sockets(s);
+ if (old_state == state)
+ return;
+
log_debug("%s changed %s → %s", unit_id(UNIT(s)), service_state_to_string(old_state), service_state_to_string(state));
unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state]);