summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-04-05 18:57:58 +0200
committerLennart Poettering <lennart@poettering.net>2013-04-05 18:57:58 +0200
commit2c4f86c1298f402220965682ab0e7729e150a562 (patch)
treef9fb52e3bdf165aae3fd6f4acbd5b032e32589a3
parent79d860fe78ff9e53fe3150fb55a8a8b03c4f6470 (diff)
logind: consider key inhibitors that are taken by non-session processes as global
This should allow system services to take over key handling for all sessions, globally.
-rw-r--r--src/login/logind-inhibit.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c
index 9994084f93..c43ae23acf 100644
--- a/src/login/logind-inhibit.c
+++ b/src/login/logind-inhibit.c
@@ -354,9 +354,14 @@ static int pid_is_active(Manager *m, pid_t pid) {
int r;
r = manager_get_session_by_pid(m, pid, &s);
- if (r <= 0)
+ if (r < 0)
return r;
+ /* If there's no session assigned to it, then it's globally
+ * active on all ttys */
+ if (r == 0)
+ return 1;
+
return session_is_active(s);
}