Commit b6ea20fe authored by Olaf Bergmann's avatar Olaf Bergmann

dcaf_address.c: use pre-processor conditional for gai_strerror

Use gai_strerror() for error output only if HAVE_GAI_STRERROR is
defined. Otherwise, the numeric error result from getaddrinfo() is
output.
parent aa225f74
......@@ -105,7 +105,11 @@ dcaf_set_coap_address(const unsigned char *host, size_t host_len,
s = getaddrinfo(addr_str, port_str, &hints, &result);
if (s != 0) {
#ifdef HAVE_GAI_STRERROR
dcaf_log(DCAF_LOG_CRIT, "getaddrinfo: %s\n", gai_strerror(s));
#else /* !HAVE_GAI_STRERROR */
dcaf_log(DCAF_LOG_CRIT, "getaddrinfo: error %d\n", s);
#endif /* !HAVE_GAI_STRERROR */
return DCAF_ERROR_INTERNAL_ERROR;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment