chiark / gitweb /
Implement masking and overriding of generators
[elogind.git] / src / sleep / sleep.c
index 2fb5f0c8e049167801a1416453cf9adcf73fdd3f..cc1ffa63f1efeb28f7e00b2e69bbed848e2e5198 100644 (file)
@@ -92,6 +92,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 +108,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 +127,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;
 }