summaryrefslogtreecommitdiff
path: root/src/sleep
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-01-22 15:22:37 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-02-20 18:49:13 -0500
commitc6e47247a745f9245eb3dbfb29fc066ef72d3886 (patch)
tree4bc9451abde3c562a24ae18c2bfcb2dee4f618c2 /src/sleep
parent504afd7c34e00eb84589e94e59cd14f2fffa2807 (diff)
basic/exec-util: add support for synchronous (ordered) execution
The output of processes can be gathered, and passed back to the callee. (This commit just implements the basic functionality and tests.) After the preparation in previous commits, the change in functionality is relatively simple. For coding convenience, alarm is prepared *before* any children are executed, and not before. This shouldn't matter usually, since just forking of the children should be pretty quick. One could also argue that this is more correct, because we will also catch the case when (for whatever reason), forking itself is slow. Three callback functions and three levels of serialization are used: - from individual generator processes to the generator forker - from the forker back to the main process - deserialization in the main process v2: - replace an structure with an indexed array of callbacks
Diffstat (limited to 'src/sleep')
-rw-r--r--src/sleep/sleep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c
index b0f992fc9c..a6978b6273 100644
--- a/src/sleep/sleep.c
+++ b/src/sleep/sleep.c
@@ -107,7 +107,7 @@ static int execute(char **modes, char **states) {
if (r < 0)
return r;
- execute_directories(dirs, DEFAULT_TIMEOUT_USEC, arguments);
+ execute_directories(dirs, DEFAULT_TIMEOUT_USEC, NULL, NULL, arguments);
log_struct(LOG_INFO,
LOG_MESSAGE_ID(SD_MESSAGE_SLEEP_START),
@@ -126,7 +126,7 @@ static int execute(char **modes, char **states) {
NULL);
arguments[1] = (char*) "post";
- execute_directories(dirs, DEFAULT_TIMEOUT_USEC, arguments);
+ execute_directories(dirs, DEFAULT_TIMEOUT_USEC, NULL, NULL, arguments);
return r;
}