summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index c4129f67c..a6847fce1 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -177,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;