X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fconfigfile.c;h=0b7786f929605a311b4c8705a48e73a80ace68b4;hb=f4c495df1843f5e87f16d122fdc78531ceb2773d;hp=fe2bce3c365124fd700becaf29599b79f103b3d5;hpb=967a0fdefd43db0e4ed5f8cba65c3c345ef6cdfb;p=collectd.git diff --git a/src/configfile.c b/src/configfile.c index fe2bce3c..0b7786f9 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -99,6 +99,7 @@ static cf_global_option_t cf_global_options[] = {"FQDNLookup", NULL, "false"}, {"Interval", NULL, "10"}, {"ReadThreads", NULL, "5"}, + {"Timeout", NULL, "2"}, {"PreCacheChain", NULL, "PreCache"}, {"PostCacheChain", NULL, "PostCache"} }; @@ -700,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)) @@ -713,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; } @@ -730,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 */