summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-06-08 20:38:55 +0200
committerLennart Poettering <lennart@poettering.net>2016-06-08 20:38:55 +0200
commite80f080bffeab01390a086c802f7e47bd11fc369 (patch)
tree7fc25712f7d19616a940e8c722fe47caf7e687bd /src
parent40652ca4791fc3ae8f55c74b16227c0682b287b9 (diff)
parenta1a8e4f5e9d87c386c630482dd288c0e354ff971 (diff)
Merge pull request #3470 from fbuihuu/logind-fix-ignore-inhibit
Logind: fix handling of *KeyIgnoreInhibited options in logind.conf
Diffstat (limited to 'src')
-rw-r--r--src/login/logind-action.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/login/logind-action.c b/src/login/logind-action.c
index 9a8089f97c..8ef48dbaa1 100644
--- a/src/login/logind-action.c
+++ b/src/login/logind-action.c
@@ -85,7 +85,7 @@ int manager_handle_action(
}
/* If the key handling is inhibited, don't do anything */
- if (inhibit_key > 0) {
+ if (!ignore_inhibited && inhibit_key > 0) {
if (manager_is_inhibited(m, inhibit_key, INHIBIT_BLOCK, NULL, true, false, 0, NULL)) {
log_debug("Refusing operation, %s is inhibited.", inhibit_what_to_string(inhibit_key));
return 0;
@@ -124,7 +124,7 @@ int manager_handle_action(
return -EALREADY;
}
- inhibit_operation = handle == HANDLE_SUSPEND || handle == HANDLE_HIBERNATE || handle == HANDLE_HYBRID_SLEEP ? INHIBIT_SLEEP : INHIBIT_SHUTDOWN;
+ inhibit_operation = IN_SET(handle, HANDLE_SUSPEND, HANDLE_HIBERNATE, HANDLE_HYBRID_SLEEP) ? INHIBIT_SLEEP : INHIBIT_SHUTDOWN;
/* If the actual operation is inhibited, warn and fail */
if (!ignore_inhibited &&