if (*ret_sockets != NULL)
return (EINVAL);
+ ai_hints.ai_flags = AI_ADDRCONFIG;
#ifdef AI_PASSIVE
ai_hints.ai_flags |= AI_PASSIVE;
#endif
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_DGRAM;
ai_hints.ai_protocol = IPPROTO_UDP;
struct addrinfo *ai_list, *ai_ptr;
int ai_return;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = PF_UNSPEC;
ai_hints.ai_socktype = SOCK_STREAM;
ai_hints.ai_protocol = IPPROTO_TCP;
addr_copy[sizeof(addr_copy) - 1] = '\0';
addr = addr_copy;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_STREAM;
if (srv->fd >= 0)
server_close_socket (srv);
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_DGRAM;
struct addrinfo *ai_list, *ai_ptr;
int ai_return;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = PF_UNSPEC;
ai_hints.ai_socktype = SOCK_STREAM;
ai_hints.ai_protocol = IPPROTO_TCP;
int status;
int fd = -1;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_STREAM;
ai_hints.ai_protocol = 0;
if ((host == NULL) || (address == NULL))
return (EINVAL);
-#if AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
/* XXX: libmodbus can only handle IPv4 addresses. */
ai_hints.ai_family = AF_INET;
ai_hints.ai_addr = NULL;
if (client->fd >= 0 && !reconnect) /* already connected and not stale*/
return (0);
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_DGRAM;
ai_hints.ai_protocol = IPPROTO_UDP;
DEBUG ("network plugin: sockent_server_listen: node = %s; service = %s;",
node, service);
+ ai_hints.ai_flags = AI_ADDRCONFIG;
#ifdef AI_PASSIVE
- ai_hints.ai_flags |= AI_PASSIVE;
-#endif
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
+ ai_hints.ai_flags |= AI_PASSIVE;
#endif
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_DGRAM;
if (strlen (port) == 0)
port = NTPD_DEFAULT_PORT;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = PF_UNSPEC;
ai_hints.ai_socktype = SOCK_DGRAM;
ai_hints.ai_protocol = IPPROTO_UDP;
FILE *fh;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = PF_UNSPEC;
ai_hints.ai_socktype = SOCK_STREAM;
ai_hints.ai_protocol = IPPROTO_TCP;
char const *service = (conf_service != NULL)
? conf_service : STATSD_DEFAULT_SERVICE;
- ai_hints.ai_flags = AI_PASSIVE;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_DGRAM;
}
/* Get all addrs for this hostname */
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_STREAM;
return (EAGAIN);
cb->last_connect_time = now;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
if (0 == strcasecmp ("tcp", cb->protocol))
host->res = NULL;
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
-#ifdef AI_ADDRCONFIG
- hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ hints.ai_flags = AI_ADDRCONFIG;
node = (host->node != NULL) ? host->node : SENSU_HOST;
service = (host->service != NULL) ? host->service : SENSU_PORT;
if (cb->sock_fd > 0)
return 0;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_STREAM;