Check value returned from ucl_parser_add_file().

Reviewed by:	trasz
Approved by:	trasz (mentor)
MFC after:	1 month
Sponsored by:	iXsystems, Inc.
This commit is contained in:
Jakub Wojciech Klama 2016-03-13 19:50:17 +00:00
parent e282d8f5bc
commit bb3844b388
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=296808

View File

@ -886,9 +886,8 @@ uclparse_conf(struct conf *newconf, const char *path)
conf = newconf;
parser = ucl_parser_new(0);
ucl_parser_add_file(parser, path);
if (ucl_parser_get_error(parser)) {
if (!ucl_parser_add_file(parser, path)) {
log_warn("unable to parse configuration file %s: %s", path,
ucl_parser_get_error(parser));
return (1);