X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fdaemon%2Fconfigfile.c;h=e61128eb6809aa63c7f03aef9dda91b1e39f3fa7;hb=084761bb8a360ac0f9e21ad43c82312676cc4a37;hp=0d295c1cbaf476d36682bef152457b19641ee599;hpb=9f77f493ef7cf6077deaa2385d2392d144cf606f;p=collectd.git diff --git a/src/daemon/configfile.c b/src/daemon/configfile.c index 0d295c1c..e61128eb 100644 --- a/src/daemon/configfile.c +++ b/src/daemon/configfile.c @@ -461,9 +461,9 @@ static int cf_ci_replace_child(oconfig_item_t *dst, oconfig_item_t *src, return 0; } - temp = - realloc(dst->children, sizeof(oconfig_item_t) * - (dst->children_num + src->children_num - 1)); + temp = realloc(dst->children, + sizeof(oconfig_item_t) * + (dst->children_num + src->children_num - 1)); if (temp == NULL) { ERROR("configfile: realloc failed."); return -1; @@ -502,8 +502,9 @@ static int cf_ci_append_children(oconfig_item_t *dst, oconfig_item_t *src) { if ((src == NULL) || (src->children_num == 0)) return 0; - temp = realloc(dst->children, sizeof(oconfig_item_t) * - (dst->children_num + src->children_num)); + temp = + realloc(dst->children, + sizeof(oconfig_item_t) * (dst->children_num + src->children_num)); if (temp == NULL) { ERROR("configfile: realloc failed."); return -1; @@ -633,9 +634,7 @@ static oconfig_item_t *cf_read_dir(const char *dir, const char *pattern, dh = opendir(dir); if (dh == NULL) { - char errbuf[1024]; - ERROR("configfile: opendir failed: %s", - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("configfile: opendir failed: %s", STRERRNO); return NULL; } @@ -764,9 +763,7 @@ static oconfig_item_t *cf_read_generic(const char *path, const char *pattern, status = stat(path_ptr, &statbuf); if (status != 0) { - char errbuf[1024]; - WARNING("configfile: stat (%s) failed: %s", path_ptr, - sstrerror(errno, errbuf, sizeof(errbuf))); + WARNING("configfile: stat (%s) failed: %s", path_ptr, STRERRNO); continue; } @@ -812,9 +809,7 @@ static oconfig_item_t *cf_read_generic(const char *path, const char *pattern, status = stat(path, &statbuf); if (status != 0) { - char errbuf[1024]; - ERROR("configfile: stat (%s) failed: %s", path, - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("configfile: stat (%s) failed: %s", path, STRERRNO); return NULL; } @@ -874,7 +869,8 @@ const char *global_option_get(const char *option) { return NULL; } - return (cf_global_options[i].value != NULL) ? cf_global_options[i].value : cf_global_options[i].def; + return (cf_global_options[i].value != NULL) ? cf_global_options[i].value + : cf_global_options[i].def; } /* char *global_option_get */ long global_option_get_long(const char *option, long default_value) { @@ -1031,6 +1027,7 @@ int cf_read(const char *filename) { } return ret; + } /* int cf_read */ /* Assures the config option is a string, duplicates it and returns the copy in