ipv6 connect sanity checking: error message if not able to connect,

instead of just segfaulting.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@442 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Peter Åstrand 2003-08-17 07:28:53 +00:00
parent 3249d71586
commit ec91795552

8
tcp.c
View File

@ -147,7 +147,7 @@ tcp_connect(char *server)
if (n < 0) if (n < 0)
{ {
error("getaddrinfo error:: [%s]\n", gai_strerror(n)); error("getaddrinfo: %s\n", gai_strerror(n));
return False; return False;
} }
@ -167,6 +167,12 @@ tcp_connect(char *server)
} }
freeaddrinfo(ressave); freeaddrinfo(ressave);
if (sock == -1)
{
error("%s: unable to connect\n", server);
return False;
}
#else /* no IPv6 support */ #else /* no IPv6 support */
struct hostent *nslookup; struct hostent *nslookup;