logind: ignore non-tty/non-x11 session when checking if there are other sessions before shutting down

https://bugzilla.redhat.com/show_bug.cgi?id=890827
This commit is contained in:
Lennart Poettering 2013-01-14 21:40:38 +01:00
parent aca26b5220
commit 1ca04b8797

View file

@ -979,9 +979,12 @@ static int have_multiple_sessions(
assert(m);
/* Check for other users' sessions. Greeter sessions do not count. */
/* Check for other users' sessions. Greeter sessions do not
* count, and non-login sessions do not count either. */
HASHMAP_FOREACH(session, m->sessions, i)
if (session->class == SESSION_USER && session->user->uid != uid)
if (session->class == SESSION_USER &&
(session->type == SESSION_TTY || session->type == SESSION_X11) &&
session->user->uid != uid)
return true;
return false;