summaryrefslogtreecommitdiff
path: root/src/login/logind-user.c
diff options
context:
space:
mode:
authorDjalal Harouni <tixxdz@opendz.org>2014-02-08 20:51:57 +0100
committerLennart Poettering <lennart@poettering.net>2014-02-11 20:31:16 +0100
commit00555a2ee1b008bccbb570320047307b8b9159f9 (patch)
tree40970434f721268780e8f804dda009c49c3f53e8 /src/login/logind-user.c
parent70d9b9fc0a4fa1698ff00e364c61bb875244efa1 (diff)
logind: use session_get_state() to get sessions state of the user
In function user_get_state() remove the session_is_active() check, just count on the session_get_state() function to get the correct session state. session_is_active() may return true before starting the session scope and user service, this means it will return true even before the creation of the session fifo_fd which will produce incorrect states. So be consistent and just use session_get_state().
Diffstat (limited to 'src/login/logind-user.c')
-rw-r--r--src/login/logind-user.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index fdbf6e3aa..06fdbb36f 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -648,9 +648,12 @@ UserState user_get_state(User *u) {
bool all_closing = true;
LIST_FOREACH(sessions_by_user, i, u->sessions) {
- if (session_is_active(i))
+ SessionState state;
+
+ state = session_get_state(i);
+ if (state == SESSION_ACTIVE)
return USER_ACTIVE;
- if (session_get_state(i) != SESSION_CLOSING)
+ if (state != SESSION_CLOSING)
all_closing = false;
}