From: Sebastian Harl Date: Thu, 20 Mar 2008 10:02:06 +0000 (+0100) Subject: configfile.c: Abort if any config file could not be read. X-Git-Tag: collectd-4.3.2~13 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=91963baa3a553d401a7decedaf5d413e08e2ae99;p=collectd.git 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 --- 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);