summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2015-03-17 17:10:56 +0100
committerPierre Ossman <ossman@cendio.se>2015-03-17 17:18:50 +0100
commitf7d15000ff8503dbd8e109c631f709fd45f1592e (patch)
treea021817279a640b6fb7da959ab22803079635670 /common
parent3ab5db438436a1a68ae76fe8799e1a3cbe8bde0b (diff)
downloadtigervnc-f7d15000ff8503dbd8e109c631f709fd45f1592e.tar.gz
tigervnc-f7d15000ff8503dbd8e109c631f709fd45f1592e.zip
Do not look at errno for getaddrinfo() errors
Diffstat (limited to 'common')
-rw-r--r--common/network/TcpSocket.cxx6
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) {