]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/socket.cpp
kick_channel -> chanrec::KickUser(), server_kick_channel -> chanrec::ServerKickUser()
[user/henk/code/inspircd.git] / src / socket.cpp
index cbb2a213c2f1eb8fedf28829c91f6682d6859838..1916bb555989bede5609ab1458c7ddccaa54698a 100644 (file)
@@ -359,8 +359,14 @@ int BindPorts(bool bail)
                                                /* Associate the new open port with a slot in the socket engine */
                                                if (Config->openSockfd[count] > -1)
                                                {
-                                                       ServerInstance->SE->AddFd(Config->openSockfd[count],true,X_LISTEN);
-                                                       BoundPortCount++;
+                                                       if (!ServerInstance->SE->AddFd(Config->openSockfd[count],true,X_LISTEN))
+                                                       {
+                                                               log(DEFAULT,"ERK! Failed to add listening port to socket engine!");
+                                                               shutdown(Config->openSockfd[count],2);
+                                                               close(Config->openSockfd[count]);
+                                                       }
+                                                       else
+                                                               BoundPortCount++;
                                                }
                                        }
                                }
@@ -419,15 +425,6 @@ int BindPorts(bool bail)
                        }
                }
        }
-
-       /* if we didn't bind to anything then abort */
-       if (!BoundPortCount)
-       {
-               log(DEFAULT,"No ports bound, bailing!");
-               printf("\nERROR: Could not bind any of %d ports! Please check your configuration.\n\n", PortCount);
-               return 0;
-       }
-
        return BoundPortCount;
 }