From 8121f4d209eca85dcb11830800483cdfafbef9b7 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Wed, 8 Jun 2016 18:08:56 +0200 Subject: logind: really handle *KeyIgnoreInhibited options in logind.conf --- src/login/logind-action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/login/logind-action.c b/src/login/logind-action.c index 9a8089f97c..95a2a01173 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; -- cgit v1.2.3-54-g00ecf From a1a8e4f5e9d87c386c630482dd288c0e354ff971 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Wed, 8 Jun 2016 18:16:42 +0200 Subject: logind: minor cleanup and use IN_SET() in manager_handle_action() --- src/login/logind-action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/login/logind-action.c b/src/login/logind-action.c index 95a2a01173..8ef48dbaa1 100644 --- a/src/login/logind-action.c +++ b/src/login/logind-action.c @@ -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 && -- cgit v1.2.3-54-g00ecf