diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/network/TcpSocket.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/common/network/TcpSocket.cxx b/common/network/TcpSocket.cxx index 1ed6df08..21c532b5 100644 --- a/common/network/TcpSocket.cxx +++ b/common/network/TcpSocket.cxx @@ -668,6 +668,7 @@ void network::createTcpListeners(std::list<TcpListener> *listeners, #ifdef HAVE_GETADDRINFO struct addrinfo *ai, *current, hints; char service[16]; + int result; initSockets(); @@ -681,8 +682,9 @@ void network::createTcpListeners(std::list<TcpListener> *listeners, snprintf (service, sizeof (service) - 1, "%d", port); service[sizeof (service) - 1] = '\0'; - if ((getaddrinfo(addr, service, &hints, &ai)) != 0) - throw rdr::SystemException("getaddrinfo", errorNumber); + if ((result = getaddrinfo(addr, service, &hints, &ai)) != 0) + throw rdr::Exception("unable to resolve listening address: %s", + gai_strerror(result)); for (current = ai; current != NULL; current = current->ai_next) { switch (current->ai_family) { |