From 347760af00d87762b3809111d8975023912ed7cc Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Mon, 20 Aug 2018 09:32:10 +0200 Subject: Prep v239: Fix sleep-config.[hc] and sleep/sleep.c to utilize upstream updates. --- src/sleep/sleep.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/sleep/sleep.c') diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c index 455c14825..cf5f49bec 100644 --- a/src/sleep/sleep.c +++ b/src/sleep/sleep.c @@ -11,15 +11,15 @@ #include "sd-messages.h" -//#include "parse-util.h" +#include "parse-util.h" #include "def.h" #include "exec-util.h" #include "fd-util.h" #include "fileio.h" //#include "log.h" -//#include "sleep-config.h" -//#include "stdio-util.h" -//#include "string-util.h" +#include "sleep-config.h" +#include "stdio-util.h" +#include "string-util.h" #include "strv.h" //#include "util.h" @@ -219,6 +219,7 @@ static int execute_s2h(usec_t hibernate_delay_sec) { char time_str[DECIMAL_STR_MAX(uint64_t)]; int r; +#if 0 /// Already parsed by elogind config r = parse_sleep_config("suspend", &suspend_modes, &suspend_states, NULL); if (r < 0) @@ -228,6 +229,7 @@ static int execute_s2h(usec_t hibernate_delay_sec) { &hibernate_states, NULL); if (r < 0) return r; +#endif // 0 r = read_wakealarm(&orig_time); if (r < 0) @@ -347,17 +349,21 @@ int main(int argc, char *argv[]) { if (r < 0) goto finish; +#else +int do_sleep(const char *verb, char **modes, char **states, usec_t delay) { + int r; + + assert(verb); + arg_verb = (char*)verb; +#endif // 0 if (streq(arg_verb, "suspend-then-hibernate")) r = execute_s2h(delay); else r = execute(modes, states); +#if 0 /// In elogind we give the result back, no interpretation here. finish: return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; -} #else -int do_sleep(const char *verb, char **modes, char **states) { - assert(verb); - arg_verb = (char*)verb; - return execute(modes, states); + return r; } #endif // 0 -- cgit v1.2.3