From: Zbigniew JÄ™drzejewski-Szmek Date: Wed, 21 Mar 2018 12:15:01 +0000 (+0100) Subject: shared/conf-parser: fix outdated comment X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c7d5f32ae1b1b79a3ce88f267f868db4106d4032;p=elogind.git shared/conf-parser: fix outdated comment --- diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 0bb8ed610..ccc102ffa 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -169,7 +169,7 @@ static int next_assignment( return 0; } -/* Parse a variable assignment line */ +/* Parse a single logical line */ static int parse_line( const char* unit, const char *filename, @@ -413,27 +413,6 @@ int config_parse(const char *unit, continuation = mfree(continuation); } - if (continuation) { - r = parse_line(unit, - filename, - ++line, - sections, - lookup, - table, - flags, - §ion, - §ion_line, - §ion_ignored, - continuation, - userdata); - if (r < 0) { - if (flags & CONFIG_PARSE_WARN) - log_warning_errno(r, "%s:%u: Failed to parse file: %m", filename, line); - return r; - - } - } - return 0; } @@ -542,8 +521,7 @@ int config_parse_many( #type, rvalue); \ \ return 0; \ - } \ - struct __useless_struct_to_allow_trailing_semicolon__ + } DEFINE_PARSER(int, int, safe_atoi); DEFINE_PARSER(long, long, safe_atoli); @@ -858,6 +836,37 @@ int config_parse_strv( return 0; } +int config_parse_warn_compat( + 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) { + Disabled reason = ltype; + + switch(reason) { + case DISABLED_CONFIGURATION: + log_syntax(unit, LOG_DEBUG, filename, line, 0, + "Support for option %s= has been disabled at compile time and it is ignored", lvalue); + break; + case DISABLED_LEGACY: + log_syntax(unit, LOG_INFO, filename, line, 0, + "Support for option %s= has been removed and it is ignored", lvalue); + break; + case DISABLED_EXPERIMENTAL: + log_syntax(unit, LOG_INFO, filename, line, 0, + "Support for option %s= has not yet been enabled and it is ignored", lvalue); + break; + }; + + return 0; +} + #if 0 /// UNNEEDED by elogind int config_parse_log_facility( const char *unit,