]> 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 04a4f5f15336aa6d78aad2cb179edeb3772ca776..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++;
                                                }
                                        }
                                }