mirror of
https://github.com/systemd/systemd.git
synced 2025-01-05 13:18:06 +03:00
Merge pull request #3470 from fbuihuu/logind-fix-ignore-inhibit
Logind: fix handling of *KeyIgnoreInhibited options in logind.conf
This commit is contained in:
commit
e80f080bff
@ -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 &&
|
||||
|
Loading…
Reference in New Issue
Block a user