diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-10-28 17:25:23 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-10-30 03:40:42 +0100 |
commit | 7ba643863116cd0b5abf048e53321f93e5743f69 (patch) | |
tree | 1728536e8916d522cb4378b3777b034e74c2a116 /src/login/logind-button.c | |
parent | faf22b6559a747ca6b2185b816d60cce376b11c8 (diff) |
logind: unify all session lock loop
Diffstat (limited to 'src/login/logind-button.c')
-rw-r--r-- | src/login/logind-button.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/login/logind-button.c b/src/login/logind-button.c index 778852698f..8bbd731ae4 100644 --- a/src/login/logind-button.c +++ b/src/login/logind-button.c @@ -150,18 +150,6 @@ fail: return r; } -static int lock_sessions(Manager *m) { - Iterator i; - Session *session; - - log_info("Locking sessions..."); - - HASHMAP_FOREACH(session, m->sessions, i) - session_send_lock(session, true); - - return 1; -} - static int button_handle( Button *b, InhibitWhat inhibit_key, @@ -208,8 +196,11 @@ static int button_handle( } /* Locking is handled differently from the rest. */ - if (handle == HANDLE_LOCK) - return lock_sessions(b->manager); + if (handle == HANDLE_LOCK) { + log_info("Locking sessions..."); + session_send_lock_all(b->manager, true); + return 1; + } inhibit_operation = handle == HANDLE_SUSPEND || handle == HANDLE_HIBERNATE || handle == HANDLE_HYBRID_SLEEP ? INHIBIT_SLEEP : INHIBIT_SHUTDOWN; |