**/
#include "collectd.h"
-#include "common.h"
+#include "common.h"
#include "plugin.h"
#include "configfile.h"
{
const char *str;
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_list;
- struct addrinfo *ai_ptr;
int status;
str = global_option_get ("Hostname");
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)
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;