summaryrefslogtreecommitdiff
path: root/src/shared/exec-util.h
diff options
context:
space:
mode:
authorMatthias Klumpp <matthias@tenstral.net>2018-09-09 03:18:45 +0200
committerLennart Poettering <lennart@poettering.net>2019-02-18 16:16:02 +0100
commit4b05f0c9d9f6df4e0dab518f8e1ae537bf948f92 (patch)
treecf8d18410cd148191d951b8f7e60006590011166 /src/shared/exec-util.h
parentbde06abd4f3febc149bf137ca68e4abaa2975b4d (diff)
downloadsystemd-4b05f0c9d9f6df4e0dab518f8e1ae537bf948f92.tar.gz
core: Allow to configure execute_directories execution behavior
This adds a new bitfield to `execute_directories()` which allows to configure whether to ignore non-zero exit statuses of binaries run and whether to allow parallel execution of commands. In case errors are not ignored, the exit status of the failed script will now be returned for error reposrting purposes or other further future use.
Diffstat (limited to 'src/shared/exec-util.h')
-rw-r--r--src/shared/exec-util.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/shared/exec-util.h b/src/shared/exec-util.h
index 6ac3c9000a..5b75a40229 100644
--- a/src/shared/exec-util.h
+++ b/src/shared/exec-util.h
@@ -14,12 +14,19 @@ enum {
_STDOUT_CONSUME_MAX,
};
+typedef enum {
+ EXEC_DIR_NONE = 0, /* No execdir flags */
+ EXEC_DIR_PARALLEL = 1 << 0, /* Execute scripts in parallel, if possible */
+ EXEC_DIR_IGNORE_ERRORS = 1 << 1, /* Ignore non-zero exit status of scripts */
+} ExecDirFlags;
+
int execute_directories(
const char* const* directories,
usec_t timeout,
gather_stdout_callback_t const callbacks[_STDOUT_CONSUME_MAX],
void* const callback_args[_STDOUT_CONSUME_MAX],
char *argv[],
- char *envp[]);
+ char *envp[],
+ ExecDirFlags flags);
extern const gather_stdout_callback_t gather_environment[_STDOUT_CONSUME_MAX];