X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind-action.c;h=bcf7b86a3b1d205bd259072345a077cab9464dce;hb=d2dedf1570f8ab5217aec3b26bf51d1d34accbde;hp=d50f6ebf6d628a799ba1571cdb03182869796595;hpb=c2c096d2926572113cba380fde34b119661d45f8;p=elogind.git diff --git a/src/login/logind-action.c b/src/login/logind-action.c index d50f6ebf6..bcf7b86a3 100644 --- a/src/login/logind-action.c +++ b/src/login/logind-action.c @@ -38,7 +38,6 @@ #include "sd-messages.h" #include "strv.h" - int manager_handle_action( Manager *m, InhibitWhat inhibit_key, @@ -94,7 +93,7 @@ int manager_handle_action( } /* 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; @@ -112,12 +111,21 @@ int manager_handle_action( 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