#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"
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)
&hibernate_states, NULL);
if (r < 0)
return r;
+#endif // 0
r = read_wakealarm(&orig_time);
if (r < 0)
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