diff options
author | Sven Eden <yamakuzure@gmx.net> | 2018-06-12 08:03:27 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-06-12 08:04:00 +0200 |
commit | 2fb9555cca94ede6ad186060e2ef72ac5ed523a2 (patch) | |
tree | 994221d58d9c9ce51716ba6ce7f26d2f07d7db83 /src | |
parent | c89778187e749926b62b76095c277c4861f907d4 (diff) |
Prep v238: Make a real distinction between 'halt' and 'poweroff'.
Diffstat (limited to 'src')
-rw-r--r-- | src/login/eloginctl.c | 5 | ||||
-rw-r--r-- | src/login/elogind-dbus.c | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/login/eloginctl.c b/src/login/eloginctl.c index 566c339c6..9349f301f 100644 --- a/src/login/eloginctl.c +++ b/src/login/eloginctl.c @@ -46,11 +46,14 @@ static const struct { HandleAction action; const char* verb; } action_table[_ACTION_MAX] = { + [ACTION_HALT] = { HANDLE_HALT, "halt" }, [ACTION_POWEROFF] = { HANDLE_POWEROFF, "poweroff", }, [ACTION_REBOOT] = { HANDLE_REBOOT, "reboot", }, + [ACTION_KEXEC] = { HANDLE_KEXEC, "kexec", }, [ACTION_SUSPEND] = { HANDLE_SUSPEND, "suspend", }, [ACTION_HIBERNATE] = { HANDLE_HIBERNATE, "hibernate", }, - [ACTION_HYBRID_SLEEP] = { HANDLE_HYBRID_SLEEP, "hybrid-sleep" }, + [ACTION_HYBRID_SLEEP] = { HANDLE_HYBRID_SLEEP, "hybrid-sleep" } + /* ACTION_CANCEL_SHUTDOWN is handled differently */ }; static int elogind_set_wall_message(sd_bus* bus, const char* msg); diff --git a/src/login/elogind-dbus.c b/src/login/elogind-dbus.c index 638376fd7..baa36b1f2 100644 --- a/src/login/elogind-dbus.c +++ b/src/login/elogind-dbus.c @@ -107,7 +107,7 @@ static int shutdown_or_sleep(Manager *m, HandleAction action) { switch (action) { case HANDLE_POWEROFF: - return run_helper(HALT); + return run_helper(POWEROFF); case HANDLE_REBOOT: return run_helper(REBOOT); case HANDLE_HALT: @@ -172,7 +172,7 @@ static int execute_shutdown_or_sleep( * sleeping processes to wake up, we have to tell them all * by ourselves. */ if (w == INHIBIT_SLEEP) { - send_prepare_for(m, w, false); + (void) send_prepare_for(m, w, false); m->action_what = 0; } else m->action_what = w; @@ -273,7 +273,7 @@ int bus_manager_shutdown_or_sleep_now_or_later( assert(w <= _INHIBIT_WHAT_MAX); /* Tell everybody to prepare for shutdown/sleep */ - send_prepare_for(m, w, true); + (void) send_prepare_for(m, w, true); delayed = m->inhibit_delay_max > 0 && |