summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-21 16:20:17 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-21 17:24:21 +0200
commitf49650cee2c5256dc0491432e1f12a4ae19be6c5 (patch)
treec66f3a0bf137948516527f86eb75b52a0de6667d /src
parent8bb2d17d2b89e87b2e9d8f6c147a757f4670b0fc (diff)
service: don't invoke functions at the same time as declaring variables
Diffstat (limited to 'src')
-rw-r--r--src/core/service.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/service.c b/src/core/service.c
index f10582d89e..fc952e848f 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -694,9 +694,13 @@ static void service_set_state(Service *s, ServiceState state) {
/* For remain_after_exit services, let's see if we can "release" the
* hold on the console, since unit_notify() only does that in case of
* change of state */
- if (state == SERVICE_EXITED && s->remain_after_exit &&
+ if (state == SERVICE_EXITED &&
+ s->remain_after_exit &&
UNIT(s)->manager->n_on_console > 0) {
- ExecContext *ec = unit_get_exec_context(UNIT(s));
+
+ ExecContext *ec;
+
+ ec = unit_get_exec_context(UNIT(s));
if (ec && exec_context_may_touch_console(ec)) {
Manager *m = UNIT(s)->manager;