{"FQDNLookup", NULL, "false"},
{"Interval", NULL, "10"},
{"ReadThreads", NULL, "5"},
+ {"Timeout", NULL, "2"},
{"PreCacheChain", NULL, "PreCache"},
{"PostCacheChain", NULL, "PostCache"}
};
ERROR ("configfile: malloc failed.");
return (NULL);
}
- memset (root, '\0', sizeof (oconfig_item_t));
+ memset (root, 0, sizeof (oconfig_item_t));
while ((de = readdir (dh)) != NULL)
{
char name[1024];
char **tmp;
- if ((de->d_name[0] == '.') || (de->d_name[0] == '\0'))
+ if ((de->d_name[0] == '.') || (de->d_name[0] == 0))
continue;
status = ssnprintf (name, sizeof (name), "%s/%s",
char *name = filenames[i];
temp = cf_read_generic (name, depth);
- if (temp == NULL) {
- int j;
- for (j = i; j < filenames_num; ++j)
- free (filenames[j]);
- free (filenames);
- oconfig_free (root);
- return (NULL);
+ if (temp == NULL)
+ {
+ /* An error should already have been reported. */
+ sfree (name);
+ continue;
}
cf_ci_append_children (root, temp);
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))
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;
}
wordfree (&we);
+ if (root->children == NULL)
+ {
+ oconfig_free (root);
+ return (NULL);
+ }
+
return (root);
} /* oconfig_item_t *cf_read_generic */
/* #endif HAVE_WORDEXP_H */