**/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
* Returns connected file objects or establishes the connection
* if it's not already present
*/
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_head;
struct addrinfo *ai_ptr;
int sd = -1;
}
/* Get all addrs for this hostname */
- ai_hints.ai_flags = AI_ADDRCONFIG;
- ai_hints.ai_family = AF_UNSPEC;
- ai_hints.ai_socktype = SOCK_STREAM;
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC,
+ .ai_flags = AI_ADDRCONFIG,
+ .ai_socktype = SOCK_STREAM
+ };
status = getaddrinfo ((config_host != NULL) ? config_host : DEFAULT_HOST,
(config_port != NULL) ? config_port : DEFAULT_PORT,