| AI_V4MAPPED; /* support IPv4 through IPv6 */
gai_return = getaddrinfo(hostname, port, &gai_hints, &gai_result);
if (gai_return != 0) {
- LOG_PERROR(LOG_WARNING, "connect_to_host(): getaddrinfo()");
+ if (gai_return == EAI_SYSTEM) {
+ LOG_PERROR(LOG_WARNING, "connect_to_host(): getaddrinfo()");
+ } else {
+ LOG(LOG_WARNING, "connect_to_host(): getaddrinfo(): %s",
+ gai_strerror(gai_return));
+ }
return -1;
}
| AI_V4MAPPED; /* support IPv4 through IPv6 */
gai_return = getaddrinfo(hostname, port, &gai_hints, &gai_result);
if (gai_return != 0) {
- perror("connect_to_host(): getaddrinfo()");
+ if (gai_return == EAI_SYSTEM) {
+ perror("connect_to_host(): getaddrinfo()");
+ } else {
+ fprintf(stderr, "connect_to_host(): getaddrinfo(): %s",
+ gai_strerror(gai_return));
+ }
return -1;
}