X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fconfigfile.c;h=99dded93c8117aca7a780cfa6ae830163304fb7c;hb=2c4059f3b4da4adceb0547bd2d7e2d69c20e1169;hp=46624dc96ce6ac7b4bd9b4fa827db014b6e041fa;hpb=9a3479d538c92e5a98b14574acd2cc4ee3a3e440;p=collectd.git diff --git a/src/configfile.c b/src/configfile.c index 46624dc9..99dded93 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -701,11 +701,10 @@ static oconfig_item_t *cf_read_generic (const char *path, int depth) if (status != 0) { char errbuf[1024]; - ERROR ("configfile: stat (%s) failed: %s", + WARNING ("configfile: stat (%s) failed: %s", path_ptr, sstrerror (errno, errbuf, sizeof (errbuf))); - oconfig_free (root); - return (NULL); + continue; } if (S_ISREG (statbuf.st_mode)) @@ -714,7 +713,7 @@ static oconfig_item_t *cf_read_generic (const char *path, int depth) temp = cf_read_dir (path_ptr, depth); else { - ERROR ("configfile: %s is neither a file nor a " + WARNING ("configfile: %s is neither a file nor a " "directory.", path); continue; } @@ -731,6 +730,12 @@ static oconfig_item_t *cf_read_generic (const char *path, int depth) wordfree (&we); + if (root->children == NULL) + { + oconfig_free (root); + return (NULL); + } + return (root); } /* oconfig_item_t *cf_read_generic */ /* #endif HAVE_WORDEXP_H */