chiark / gitweb /
logind: use session_get_state() to get sessions state of the user
[elogind.git] / src / login / logind-user.c
index fdbf6e3aa08ef73df5e30a283932004e49e34b45..06fdbb36fc9758fc307b1dc43000db5fc8609181 100644 (file)
@@ -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;
                 }