From c8917bfd81e4b7d330d5113af669c739ade6b02b Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 19 Oct 2017 07:26:34 +0200 Subject: [PATCH] clang-format -style=file -i src/daemon/{collectd,configfile,globals}.c --- src/daemon/collectd.c | 13 +++++-------- src/daemon/configfile.c | 11 ++++++----- src/daemon/globals.c | 2 +- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/daemon/collectd.c b/src/daemon/collectd.c index 4df11bcf..dd9b12f8 100644 --- a/src/daemon/collectd.c +++ b/src/daemon/collectd.c @@ -463,12 +463,11 @@ void read_cmdline(int argc, char **argv, struct cmdline_config *config) { /* read options */ while (1) { int c; - c = getopt(argc, argv, - "htTC:" + c = getopt(argc, argv, "htTC:" #if COLLECT_DAEMON - "fP:" + "fP:" #endif - ); + ); if (c == -1) break; @@ -553,9 +552,7 @@ int main(int argc, char **argv) { int exit_status = 0; struct cmdline_config config = { - .daemonize = 1, - .create_basedir = 1, - .configfile = CONFIGFILE, + .daemonize = 1, .create_basedir = 1, .configfile = CONFIGFILE, }; read_cmdline(argc, argv, &config); @@ -588,7 +585,7 @@ int main(int argc, char **argv) { #ifdef KERNEL_LINUX && notify_upstart() == 0 && notify_systemd() == 0 #endif - ) { + ) { int status; if ((pid = fork()) == -1) { diff --git a/src/daemon/configfile.c b/src/daemon/configfile.c index 83e44b72..f5086ae6 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; diff --git a/src/daemon/globals.c b/src/daemon/globals.c index 207ca05d..5c6749ff 100644 --- a/src/daemon/globals.c +++ b/src/daemon/globals.c @@ -21,8 +21,8 @@ * DEALINGS IN THE SOFTWARE. **/ -#include "globals.h" #include "common.h" +#include "globals.h" #if HAVE_KSTAT_H #include -- 2.11.0