summaryrefslogtreecommitdiff
path: root/src/login/logind-button.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/login/logind-button.c')
-rw-r--r--src/login/logind-button.c19
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;