From: Yu Watanabe Date: Tue, 29 May 2018 03:52:14 +0000 (+0900) Subject: load-fragment: make IPTOS= accept the empty string X-Git-Tag: v239~179^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e405b67d23f884350b4e1a5a06c6c5c52b8dabbe;p=thirdparty%2Fsystemd.git load-fragment: make IPTOS= accept the empty string --- diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 842f7c3896b..1b4702872cb 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -2455,33 +2455,7 @@ int config_parse_log_extra_fields( } } -int config_parse_ip_tos(const char *unit, - const char *filename, - unsigned line, - const char *section, - unsigned section_line, - const char *lvalue, - int ltype, - const char *rvalue, - void *data, - void *userdata) { - - int *ip_tos = data, x; - - assert(filename); - assert(lvalue); - assert(rvalue); - assert(data); - - x = ip_tos_from_string(rvalue); - if (x < 0) { - log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse IP TOS value, ignoring: %s", rvalue); - return 0; - } - - *ip_tos = x; - return 0; -} +DEFINE_CONFIG_PARSE_ENUM_WITH_DEFAULT(config_parse_ip_tos, ip_tos, int, -1, "Failed to parse IP TOS value"); int config_parse_unit_condition_path( const char *unit,