chiark / gitweb /
Remove src/core
[elogind.git] / src / sleep / sleep.c
index 2fb5f0c8e049167801a1416453cf9adcf73fdd3f..eee6bc89829ab9a8f2d24255e28d5ecc804451b6 100644 (file)
 
 #include <stdio.h>
 #include <errno.h>
-#include <string.h>
 #include <getopt.h>
 
-#include "sd-id128.h"
 #include "sd-messages.h"
 #include "log.h"
 #include "util.h"
@@ -92,6 +90,7 @@ static int execute(char **modes, char **states) {
                 arg_verb,
                 NULL
         };
+        static const char* const dirs[] = {SYSTEM_SLEEP_PATH, NULL};
 
         int r;
         _cleanup_fclose_ FILE *f = NULL;
@@ -107,7 +106,7 @@ static int execute(char **modes, char **states) {
         if (r < 0)
                 return r;
 
-        execute_directory(SYSTEM_SLEEP_PATH, DEFAULT_TIMEOUT_USEC, arguments);
+        execute_directories(dirs, DEFAULT_TIMEOUT_USEC, arguments);
 
         log_struct(LOG_INFO,
                    LOG_MESSAGE_ID(SD_MESSAGE_SLEEP_START),
@@ -126,7 +125,7 @@ static int execute(char **modes, char **states) {
                    NULL);
 
         arguments[1] = (char*) "post";
-        execute_directory(SYSTEM_SLEEP_PATH, DEFAULT_TIMEOUT_USEC, arguments);
+        execute_directories(dirs, DEFAULT_TIMEOUT_USEC, arguments);
 
         return r;
 }