**/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
static FILE *olsrd_connect (void) /* {{{ */
{
- struct addrinfo *ai_list, *ai_ptr;
+ struct addrinfo *ai_list;
int ai_return;
FILE *fh;
- ai_list = NULL;
-
struct addrinfo ai_hints = {
- .ai_family = PF_UNSPEC,
+ .ai_family = AF_UNSPEC,
.ai_flags = AI_ADDRCONFIG,
.ai_protocol = IPPROTO_TCP,
.ai_socktype = SOCK_STREAM
}
fh = NULL;
- 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)
{
int fd;
int status;