#include "bus-error.h"
#include "bus-util.h"
#include "conf-parser.h"
-#include "formats-util.h"
+#include "format-util.h"
#include "logind-action.h"
#include "process-util.h"
#include "sleep-config.h"
#include "sd-messages.h"
#include "strv.h"
-
int manager_handle_action(
Manager *m,
InhibitWhat inhibit_key,
}
/* If the key handling is inhibited, don't do anything */
- if (!ignore_inhibited && inhibit_key > 0) {
+ if (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;
return 1;
}
+#if 0 /// elogind needs its own can_sleep() variant.
+ if (handle == HANDLE_SUSPEND)
+ supported = can_sleep("suspend") > 0;
+ else if (handle == HANDLE_HIBERNATE)
+ supported = can_sleep("hibernate") > 0;
+ else if (handle == HANDLE_HYBRID_SLEEP)
+ supported = can_sleep("hybrid-sleep") > 0;
+#else
if (handle == HANDLE_SUSPEND)
supported = can_sleep(m, "suspend") > 0;
else if (handle == HANDLE_HIBERNATE)
supported = can_sleep(m, "hibernate") > 0;
else if (handle == HANDLE_HYBRID_SLEEP)
supported = can_sleep(m, "hybrid-sleep") > 0;
+#endif // 0
else if (handle == HANDLE_KEXEC)
supported = access(KEXEC, X_OK) >= 0;
else