Use gai_strerror instead of Utility::FormatErrorNumber for getaddrinfo's error codes

fixes #6849
This commit is contained in:
Gunnar Beutner 2014-08-06 10:43:41 +02:00
parent 595728d024
commit 8256638fde
1 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ void TcpSocket::Bind(const String& node, const String& service, int family)
if (rc != 0) {
std::ostringstream msgbuf;
msgbuf << "getaddrinfo() failed with return code " << rc << ", \"" << Utility::FormatErrorNumber(rc) << "\"";
msgbuf << "getaddrinfo() failed with return code " << rc << ", \"" << gai_strerror(rc) << "\"";
Log(LogCritical, "TcpSocket", msgbuf.str());
BOOST_THROW_EXCEPTION(socket_error()
@ -156,7 +156,7 @@ void TcpSocket::Connect(const String& node, const String& service)
if (rc != 0) {
std::ostringstream msgbuf;
msgbuf << "getaddrinfo() failed with return code " << rc << ", \"" << Utility::FormatErrorNumber(rc) << "\"";
msgbuf << "getaddrinfo() failed with return code " << rc << ", \"" << gai_strerror(rc) << "\"";
Log(LogCritical, "TcpSocket", msgbuf.str());
BOOST_THROW_EXCEPTION(socket_error()