summaryrefslogtreecommitdiff
path: root/src/shared/conf-parser.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-05-31 04:27:03 +0200
committerLennart Poettering <lennart@poettering.net>2012-05-31 04:27:03 +0200
commitd88a251b125f6e9178b9ca9ea47ab7da3234cb58 (patch)
tree6c982e764f991ed9169bd4fb53a601dcd295795b /src/shared/conf-parser.c
parent256425cc10d74c13602527eb86b4ba0938964565 (diff)
util: introduce a proper nsec_t and make use of it where appropriate
Diffstat (limited to 'src/shared/conf-parser.c')
-rw-r--r--src/shared/conf-parser.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index 65035e4c6a..724bcf00c9 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -817,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,