chiark / gitweb /
logind: properly clean up user cgroups when they run empty
[elogind.git] / src / shared / conf-parser.c
index 30980a3ea228d0d213c6e7ae7464ec5655e7d940..724bcf00c96f985bf661110b8813fc4c4e2c062d 100644 (file)
@@ -31,6 +31,7 @@
 #include "strv.h"
 #include "log.h"
 #include "utf8.h"
+#include "path-util.h"
 
 int config_item_table_lookup(
                 void *table,
@@ -816,6 +817,31 @@ int config_parse_usec(
         return 0;
 }
 
+int config_parse_nsec(
+                const char *filename,
+                unsigned line,
+                const char *section,
+                const char *lvalue,
+                int ltype,
+                const char *rvalue,
+                void *data,
+                void *userdata) {
+
+        nsec_t *nsec = data;
+
+        assert(filename);
+        assert(lvalue);
+        assert(rvalue);
+        assert(data);
+
+        if (parse_nsec(rvalue, nsec) < 0) {
+                log_error("[%s:%u] Failed to parse time value, ignoring: %s", filename, line, rvalue);
+                return 0;
+        }
+
+        return 0;
+}
+
 int config_parse_mode(
                 const char *filename,
                 unsigned line,