]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/socket.cpp
Forward port of CullList and my bragging rights
[user/henk/code/inspircd.git] / src / socket.cpp
index f9b605d3be05a2a1377d18ece0befafca5489261..a6847fce15ace794a9330772acf3c3b3c4d85a20 100644 (file)
@@ -28,8 +28,6 @@ extern ServerConfig* Config;
 extern time_t TIME;
 extern int openSockfd[MAX_DESCRIPTORS];
 
-InspSocket* socket_ref[MAX_DESCRIPTORS];
-
 /** This will bind a socket to a port. It works for UDP/TCP.
  * If a hostname is given to bind to, the function will first
  * attempt to resolve the hostname, then bind to the IP the 
@@ -179,8 +177,11 @@ int BindPorts(bool bail)
                                else
                                {
                                        /* Associate the new open port with a slot in the socket engine */
-                                       ServerInstance->SE->AddFd(openSockfd[count],true,X_LISTEN);
-                                       BoundPortCount++;
+                                       if (openSockfd[count] > -1)
+                                       {
+                                               ServerInstance->SE->AddFd(openSockfd[count],true,X_LISTEN);
+                                               BoundPortCount++;
+                                       }
                                }
                        }
                        return InitialPortCount + BoundPortCount;