diff options
author | Sven Eden <yamakuzure@gmx.net> | 2017-02-01 08:48:13 +0100 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-03-14 10:23:13 +0100 |
commit | e19b8719a54c343372e16b462c27f1e84c987b85 (patch) | |
tree | c282d4e5d33330d0b6516f5d2274f053b7abe31f /src/basic/util.c | |
parent | 059696ac014da265ee2d1b062cd0dc7bee3d2001 (diff) |
Handle suspend, shutdown, reboot, etc within elogind
Since we are catching the keys, we might as well just do
suspend/reboot/etc handling here.
* configure.ac: Get paths of halt and reboot.
* Makefile.am (systemsleepdir, systemshutdowndir): New variables. Look
in them for hooks to run.
* src/login/logind-action.c: Inline the salient bits from systemd's
sleep/sleep.c here.
* src/login/logind-dbus.c (execute_shutdown_or_sleep): Call our own
shutdown_or_sleep helper instead of invoking a systemd method.
* src/login/logind-action.h: Declare shutdown_or_sleep.
Diffstat (limited to 'src/basic/util.c')
-rw-r--r-- | src/basic/util.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/basic/util.c b/src/basic/util.c index 3df91488c..38de72966 100644 --- a/src/basic/util.c +++ b/src/basic/util.c @@ -79,7 +79,8 @@ #include "mkdir.h" #include "path-util.h" // #include "exit-status.h" -// #include "hashmap.h" +#include "hashmap.h" +#include "set.h" // #include "env-util.h" #include "fileio.h" // #include "device-nodes.h" @@ -2890,8 +2891,6 @@ bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) { return endswith(de->d_name, suffix); } -/// UNNEEDED by elogind -#if 0 static int do_execute(char **directories, usec_t timeout, char *argv[]) { _cleanup_hashmap_free_free_ Hashmap *pids = NULL; _cleanup_set_free_free_ Set *seen = NULL; @@ -3031,7 +3030,6 @@ void execute_directories(const char* const* directories, usec_t timeout, char *a wait_for_terminate_and_warn(name, executor_pid, true); } -#endif // 0 bool nulstr_contains(const char*nulstr, const char *needle) { const char *i; |