chiark / gitweb /
journalctl: rework short output mode to rebuild full syslog message
[elogind.git] / src / conf-parser.c
index 3bb430e375183499889243ee9ef14169e141123a..3ccd1c067a20c13b0aa085fa8d9a4093af3d6a63 100644 (file)
@@ -314,7 +314,7 @@ int config_parse(
                                 continuation = c;
                         else {
                                 continuation = strdup(l);
-                                if (!c) {
+                                if (!continuation) {
                                         r = -ENOMEM;
                                         goto finish;
                                 }
@@ -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;
+}