summaryrefslogtreecommitdiff
path: root/src/conf-parser.c
diff options
context:
space:
mode:
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;
+}