summaryrefslogtreecommitdiff
path: root/src/conf-parser.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-01-18 15:40:21 +0100
committerLennart Poettering <lennart@poettering.net>2012-01-18 15:40:21 +0100
commit8d53b4534a5923721b5f1e9dd7e8f4a903d02d51 (patch)
tree7b0a03a93fc3aa706676713e8062bdbb6dc4ad2d /src/conf-parser.c
parent62f21ec91ad8e7e24079962f4df066b0094fe68d (diff)
exec: introduce ControlGroupPersistant= to make cgroups persistant
Diffstat (limited to 'src/conf-parser.c')
-rw-r--r--src/conf-parser.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/conf-parser.c b/src/conf-parser.c
index 3ccd1c067a..ac8d9f5ac5 100644
--- a/src/conf-parser.c
+++ b/src/conf-parser.c
@@ -509,6 +509,36 @@ int config_parse_bool(
return 0;
}
+int config_parse_tristate(
+ const char *filename,
+ unsigned line,
+ const char *section,
+ const char *lvalue,
+ int ltype,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+
+ int k;
+ int *b = data;
+
+ assert(filename);
+ assert(lvalue);
+ assert(rvalue);
+ assert(data);
+
+ /* Tristates are like booleans, but can also take the 'default' value, i.e. "-1" */
+
+ k = parse_boolean(rvalue);
+ if (k < 0) {
+ log_error("[%s:%u] Failed to parse boolean value, ignoring: %s", filename, line, rvalue);
+ return 0;
+ }
+
+ *b = !!k;
+ return 0;
+}
+
int config_parse_string(
const char *filename,
unsigned line,