summaryrefslogtreecommitdiff
path: root/src/shared/conf-parser.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-03-21 13:15:01 +0100
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commitc7d5f32ae1b1b79a3ce88f267f868db4106d4032 (patch)
treecce97db989b5a6d8ca1d09d32b6783c0679eca0e /src/shared/conf-parser.c
parentbe4e039d977bcee04fedcdb7a6a4b5c18cfaca38 (diff)
shared/conf-parser: fix outdated comment
Diffstat (limited to 'src/shared/conf-parser.c')
-rw-r--r--src/shared/conf-parser.c57
1 files changed, 33 insertions, 24 deletions
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,
- &section,
- &section_line,
- &section_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,