Message ID | 1608332802-9720-4-git-send-email-bmarzins@redhat.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | christophe varoqui |
Headers | show |
Series | More misc multipath patches | expand |
On Fri, 2020-12-18 at 17:06 -0600, Benjamin Marzinski wrote: > Multipath doesn't warn when multipath.conf is missing closing braces > at > the end of the file. This has confused people about the correct > config > file syntax, so add a warning. > > Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
diff --git a/libmultipath/parser.c b/libmultipath/parser.c index 163ffbc9..c70243c3 100644 --- a/libmultipath/parser.c +++ b/libmultipath/parser.c @@ -537,7 +537,7 @@ process_stream(struct config *conf, FILE *stream, vector keywords, if (!strcmp(str, EOB)) { if (kw_level > 0) { free_strvec(strvec); - break; + goto out; } condlog(0, "unmatched '%s' at line %d of %s", EOB, line_nr, file); @@ -576,7 +576,8 @@ process_stream(struct config *conf, FILE *stream, vector keywords, free_strvec(strvec); } - + if (kw_level == 1) + condlog(1, "missing '%s' at end of %s", EOB, file); out: FREE(buf); free_uniques(uniques);
Multipath doesn't warn when multipath.conf is missing closing braces at the end of the file. This has confused people about the correct config file syntax, so add a warning. Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> --- libmultipath/parser.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)