summaryrefslogtreecommitdiff
path: root/src/core/load-fragment.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-26 01:39:53 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-26 02:26:31 +0100
commitd420282b28f50720e233ccb1c02547c562195653 (patch)
tree6e03a30a4584bf5345fe7fdc1f551dba5b93458a /src/core/load-fragment.c
parent02b59d57e0c08231645120077f651151f5bb2bab (diff)
core: replace OnFailureIsolate= setting by a more generic OnFailureJobMode= setting and make use of it where applicable
Diffstat (limited to 'src/core/load-fragment.c')
-rw-r--r--src/core/load-fragment.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index e9bfbd396d..d9dd6faaeb 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -2326,6 +2326,37 @@ int config_parse_blockio_bandwidth(
return 0;
}
+DEFINE_CONFIG_PARSE_ENUM(config_parse_job_mode, job_mode, JobMode, "Failed to parse job mode");
+
+int config_parse_job_mode_isolate(
+ const char *unit,
+ const char *filename,
+ unsigned line,
+ const char *section,
+ unsigned section_line,
+ const char *lvalue,
+ int ltype,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+
+ JobMode *m = data;
+ int r;
+
+ assert(filename);
+ assert(lvalue);
+ assert(rvalue);
+
+ r = parse_boolean(rvalue);
+ if (r < 0) {
+ log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Failed to parse boolean, ignoring: %s", rvalue);
+ return 0;
+ }
+
+ *m = r ? JOB_ISOLATE : JOB_REPLACE;
+ return 0;
+}
+
#define FOLLOW_MAX 8
static int open_follow(char **filename, FILE **_f, Set *names, char **_final) {