summaryrefslogtreecommitdiff
path: root/src/login/logind.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2015-06-08 22:58:50 +0200
committerDaniel Mack <daniel@zonque.org>2015-06-25 17:18:41 +0200
commit418b22b88f79911fe5d76fabedd18ef1eb491680 (patch)
treebec913e91eab644d6f7fe76fd3a9e751f4eda84c /src/login/logind.c
parent906fa490769c4bdb3be1e90ac7d16f66120608c7 (diff)
logind: fix delayed execution regression
Commit c0f32805 ("logind: use sd_event timer source for inhibitor logic") reworked the main loop logic of logind so that it uses a real timeout callback handler to execute delayed functions. What the old code did, however, was to call those functions on every iteration in the main loop, not only when the timeout expired. Restore that behavior by bringing back manager_dispatch_delayed(), and call it from manager_run(). The internal event source callback manager_inhibit_timeout_handler() was turned into a wrapper of manager_dispatch_delayed() now.
Diffstat (limited to 'src/login/logind.c')
-rw-r--r--src/login/logind.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/login/logind.c b/src/login/logind.c
index 01f7cd9ee0..e2fb496289 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -1109,6 +1109,12 @@ static int manager_run(Manager *m) {
manager_gc(m, true);
+ r = manager_dispatch_delayed(m, false);
+ if (r < 0)
+ return r;
+ if (r > 0)
+ continue;
+
r = sd_event_run(m->event, (uint64_t) -1);
if (r < 0)
return r;