From: Lennart Poettering Date: Fri, 5 Apr 2013 16:57:58 +0000 (+0200) Subject: logind: consider key inhibitors that are taken by non-session processes as global X-Git-Tag: v201~39 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=2c4f86c1298f402220965682ab0e7729e150a562;p=elogind.git 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. --- diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c index 9994084f9..c43ae23ac 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); }