irc_login: csocket holds a valid descriptor or -1 on error
authorMarkus Bröker <mbroeker@largo.dyndns.tv>
Sat, 13 Nov 2010 15:49:44 +0100
changeset 59 e8f15b159e19
parent 58 500a5ea7fcb8
child 60 67a32e9d95f2
irc_login: csocket holds a valid descriptor or -1 on error committer: Markus Bröker <mbroeker@largo.homelinux.org>
src/irc.c
--- a/src/irc.c
+++ b/src/irc.c
@@ -62,12 +62,13 @@
             break;
         }
         close (csocket);
+        csocket = -1;
     }
 
     if (result != NULL)
         freeaddrinfo (result);
 
-    if (csocket < 0) {
+    if (csocket == -1) {
         perror ("Cannot connect");
         return NULL;
     }