From 91963baa3a553d401a7decedaf5d413e08e2ae99 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 20 Mar 2008 11:02:06 +0100 Subject: [PATCH] configfile.c: Abort if any config file could not be read. So far, when including all files from some directory, errors while reading any of those config files have been reported but otherwise ignored. So, collectd would run with some potentially incomplete configuration which is not what I would expect. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- src/configfile.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/configfile.c b/src/configfile.c index ef997fac..63b926af 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -546,12 +546,15 @@ static oconfig_item_t *cf_read_dir (const char *dir, int depth) ERROR ("configfile: Not including `%s/%s' because its" " name is too long.", dir, de->d_name); - continue; + oconfig_free (root); + return (NULL); } temp = cf_read_generic (name, depth); - if (temp == NULL) - continue; + if (temp == NULL) { + oconfig_free (root); + return (NULL); + } cf_ci_append_children (root, temp); sfree (temp->children); -- 2.11.0