summaryrefslogtreecommitdiff
path: root/src/socketengines/socketengine_epoll.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-07 13:47:26 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-07 13:47:26 +0200
commit5a6fd54f8fd217232f98804431928609580742bc (patch)
tree8bed7bfab1526fcd1ef691d2483cbb9400dcfd72 /src/socketengines/socketengine_epoll.cpp
parent76f1ba946972dbff089b27d64748afc1c0d95c6a (diff)
Change the number reported by SocketEngine::GetMaxFds() to be informal
Do not exit if we can't determine it
Diffstat (limited to 'src/socketengines/socketengine_epoll.cpp')
-rw-r--r--src/socketengines/socketengine_epoll.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/socketengines/socketengine_epoll.cpp b/src/socketengines/socketengine_epoll.cpp
index 1c4d8963d..7d919ec9f 100644
--- a/src/socketengines/socketengine_epoll.cpp
+++ b/src/socketengines/socketengine_epoll.cpp
@@ -42,17 +42,8 @@ namespace
void SocketEngine::Init()
{
- int max = ulimit(4, 0);
- if (max > 0)
- {
- MAX_DESCRIPTORS = max;
- }
- else
- {
- ServerInstance->Logs->Log("SOCKET", LOG_DEFAULT, "ERROR: Can't determine maximum number of open sockets!");
- std::cout << "ERROR: Can't determine maximum number of open sockets!" << std::endl;
- ServerInstance->QuickExit(EXIT_STATUS_SOCKETENGINE);
- }
+ // MAX_DESCRIPTORS is mainly used for display purposes, no problem if ulimit() fails and returns a negative number
+ MAX_DESCRIPTORS = ulimit(4, 0);
// 128 is not a maximum, just a hint at the eventual number of sockets that may be polled,
// and it is completely ignored by 2.6.8 and later kernels, except it must be larger than zero.