diff options
author | Andy Wingo <wingo@pobox.com> | 2015-08-23 12:28:10 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2015-08-23 12:28:10 +0200 |
commit | 06ca7594edc2bf54a32f0fe86fc65976c70f1f11 (patch) | |
tree | 36ec70787c215b0af91ef3c79d282796dc1037f8 /src/login/logind-action.c | |
parent | fb9ec2d4fc198bcb47352cfce7d436901308eed8 (diff) |
Beginnings of handling suspend/etc within logind
Since we are catching the keys, we might as well just do
suspend/reboot/etc handling here.
Diffstat (limited to 'src/login/logind-action.c')
-rw-r--r-- | src/login/logind-action.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/login/logind-action.c b/src/login/logind-action.c index 281e3c7569..ce7f681040 100644 --- a/src/login/logind-action.c +++ b/src/login/logind-action.c @@ -45,16 +45,6 @@ int manager_handle_action( [HANDLE_HYBRID_SLEEP] = "Hibernating and suspending..." }; - static const char * const target_table[_HANDLE_ACTION_MAX] = { - [HANDLE_POWEROFF] = SPECIAL_POWEROFF_TARGET, - [HANDLE_REBOOT] = SPECIAL_REBOOT_TARGET, - [HANDLE_HALT] = SPECIAL_HALT_TARGET, - [HANDLE_KEXEC] = SPECIAL_KEXEC_TARGET, - [HANDLE_SUSPEND] = SPECIAL_SUSPEND_TARGET, - [HANDLE_HIBERNATE] = SPECIAL_HIBERNATE_TARGET, - [HANDLE_HYBRID_SLEEP] = SPECIAL_HYBRID_SLEEP_TARGET - }; - _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; InhibitWhat inhibit_operation; Inhibitor *offending = NULL; @@ -150,7 +140,7 @@ int manager_handle_action( log_info("%s", message_table[handle]); - r = bus_manager_shutdown_or_sleep_now_or_later(m, target_table[handle], inhibit_operation, &error); + r = bus_manager_shutdown_or_sleep_now_or_later(m, handle, inhibit_operation, &error); if (r < 0) { log_error("Failed to execute operation: %s", bus_error_message(&error, r)); return r; |