X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fdaemon%2Fcollectd.c;h=8573579166ab7e0aa13078d934ec92ffbf30324e;hb=4979d8dcd6f097eb8fd4661086e28accd31ff905;hp=840520887b3352a70dc19d6243b9c8fe58f81430;hpb=362a519e00d50fc3657d485135075f753ec71bab;p=collectd.git diff --git a/src/daemon/collectd.c b/src/daemon/collectd.c index 84052088..85735791 100644 --- a/src/daemon/collectd.c +++ b/src/daemon/collectd.c @@ -26,8 +26,8 @@ **/ #include "collectd.h" -#include "common.h" +#include "common.h" #include "plugin.h" #include "configfile.h" @@ -97,9 +97,7 @@ static int init_hostname (void) { const char *str; - struct addrinfo ai_hints = { 0 }; struct addrinfo *ai_list; - struct addrinfo *ai_ptr; int status; str = global_option_get ("Hostname"); @@ -120,7 +118,9 @@ static int init_hostname (void) if (IS_FALSE (str)) return (0); - ai_hints.ai_flags = AI_CANONNAME; + struct addrinfo ai_hints = { + .ai_flags = AI_CANONNAME + }; status = getaddrinfo (hostname_g, NULL, &ai_hints, &ai_list); if (status != 0) @@ -133,7 +133,7 @@ static int init_hostname (void) return (-1); } - for (ai_ptr = ai_list; ai_ptr != NULL; ai_ptr = ai_ptr->ai_next) + for (struct addrinfo *ai_ptr = ai_list; ai_ptr != NULL; ai_ptr = ai_ptr->ai_next) { if (ai_ptr->ai_canonname == NULL) continue;