From e405b67d23f884350b4e1a5a06c6c5c52b8dabbe Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 29 May 2018 12:52:14 +0900 Subject: [PATCH] load-fragment: make IPTOS= accept the empty string --- src/core/load-fragment.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) 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, -- 2.47.3