X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fconf-parser.c;h=724bcf00c96f985bf661110b8813fc4c4e2c062d;hb=8c8c43515cee56dfc2298998a9e5958308c46f99;hp=a9b01135e6a1dfc7a3bcbd335b6d59c1a21cb7be;hpb=d7832d2c6e0ef5f2839a2296c1cc2fc85c7d9632;p=elogind.git diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index a9b01135e..724bcf00c 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -6,16 +6,16 @@ Copyright 2010 Lennart Poettering systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. systemd is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Lesser General Public License along with systemd; If not, see . ***/ @@ -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,