C API improperly logs getaddrinfo failures on Linux when using glibc
--------------------------------------------------------------------
Key: ZOOKEEPER-1451
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1451
Project: ZooKeeper
Issue Type: Bug
Components: c client
Environment: Linux when using glibc
Reporter: Stephen Tyree
Assignee: Stephen Tyree
Priority: Trivial
This is how the code currently logs getaddrinfo errors:
{quote}
errno = getaddrinfo_errno(rc);
LOG_ERROR(("getaddrinfo: %s\n", strerror(errno)));
{quote}
On Linux, specifically when using glibc, there is a better function for logging
getaddrinfo errors called gai_strerror. An example:
{quote}
LOG_ERROR(("getaddrinfo: %s\n", gai_strerror(rc)));
{quote}
It doesn't miss a lot of cases like the errno based version does.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira