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;
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;
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;
}
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;
}
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;
}
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) {
}
return ret;
+
} /* int cf_read */
/* Assures the config option is a string, duplicates it and returns the copy in