X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fconf-parser.c;h=3ccd1c067a20c13b0aa085fa8d9a4093af3d6a63;hb=6bd9fe5a734893262f2932a8e1fcfe05796f0105;hp=a71dcd0d8fb8c87460ea24f81b244334ce740519;hpb=8ea913b2eaadbd92e069ea6b71cc5f5df409decf;p=elogind.git diff --git a/src/conf-parser.c b/src/conf-parser.c index a71dcd0d8..3ccd1c067 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) { + + off_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; +}