summaryrefslogtreecommitdiff
path: root/src/conf-parser.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-01-04 20:40:04 +0100
committerLennart Poettering <lennart@poettering.net>2012-01-04 20:40:04 +0100
commite6960940b6dc5ab81eb2fca4061c333e1795f38d (patch)
tree08ec0a8cc0bcc64f4a053d24a101101d71c96033 /src/conf-parser.c
parent3606df64abfa79e8fad7bd75c8634c116a6f1c96 (diff)
journald: parse configuration file
Diffstat (limited to 'src/conf-parser.c')
-rw-r--r--src/conf-parser.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/conf-parser.c b/src/conf-parser.c
index a71dcd0d8f..b60f93d7a4 100644
--- a/src/conf-parser.c
+++ b/src/conf-parser.c
@@ -752,3 +752,30 @@ int config_parse_mode(
*m = (mode_t) l;
return 0;
}
+
+int config_parse_bytes(
+ const char *filename,
+ unsigned line,
+ const char *section,
+ const char *lvalue,
+ int ltype,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+
+ uint64_t *bytes = data;
+
+ assert(filename);
+ assert(lvalue);
+ assert(rvalue);
+ assert(data);
+
+ assert_cc(sizeof(off_t) == sizeof(uint64_t));
+
+ if (parse_bytes(rvalue, bytes) < 0) {
+ log_error("[%s:%u] Failed to parse bytes value, ignoring: %s", filename, line, rvalue);
+ return 0;
+ }
+
+ return 0;
+}