aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/socket.c b/socket.c
index 64d7481e..3dcdccaa 100644
--- a/socket.c
+++ b/socket.c
@@ -52,10 +52,7 @@ int clientPort;
if (sock < 0)
return (FILE *)NULL;
- /* under 2.0.23, connect(2) doesn't return -1 on ENETUNREACH failure */
- errno = 0;
- connect(sock, (struct sockaddr *) &ad, sizeof(ad));
- if (errno != 0)
+ if (connect(sock, (struct sockaddr *) &ad, sizeof(ad)) < 0)
{
close(sock);
return (FILE *)NULL;