diff options
| author | 2017-10-22 03:10:48 +0100 | |
|---|---|---|
| committer | 2017-10-22 19:45:05 +0100 | |
| commit | 63e300ed082b82530ad5ae0949f45686746b7c9b (patch) | |
| tree | 652448c5c2bd134df654b49b3aec7d82899abf64 /src/socketengines/socketengine_epoll.cpp | |
| parent | Convert GetMaxFds() to size_t and deduplicate setting code. (diff) | |
| download | inspircd++-63e300ed082b82530ad5ae0949f45686746b7c9b.tar.gz inspircd++-63e300ed082b82530ad5ae0949f45686746b7c9b.tar.bz2 inspircd++-63e300ed082b82530ad5ae0949f45686746b7c9b.zip | |
Deduplicate error handling in the socket engines.
Diffstat (limited to 'src/socketengines/socketengine_epoll.cpp')
| -rw-r--r-- | src/socketengines/socketengine_epoll.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/socketengines/socketengine_epoll.cpp b/src/socketengines/socketengine_epoll.cpp index dc10a3613..60b365ee1 100644 --- a/src/socketengines/socketengine_epoll.cpp +++ b/src/socketengines/socketengine_epoll.cpp @@ -19,11 +19,9 @@ #include "inspircd.h" -#include "exitcodes.h" #include <sys/epoll.h> #include <sys/resource.h> -#include <iostream> /** A specialisation of the SocketEngine class, designed to use linux 2.6 epoll(). */ @@ -43,15 +41,8 @@ void SocketEngine::Init() // 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. EngineHandle = epoll_create(128); - if (EngineHandle == -1) - { - ServerInstance->Logs->Log("SOCKET", LOG_DEFAULT, "ERROR: Could not initialize socket engine: %s", strerror(errno)); - ServerInstance->Logs->Log("SOCKET", LOG_DEFAULT, "ERROR: Your kernel probably does not have the proper features. This is a fatal error, exiting now."); - std::cout << "ERROR: Could not initialize epoll socket engine: " << strerror(errno) << std::endl; - std::cout << "ERROR: Your kernel probably does not have the proper features. This is a fatal error, exiting now." << std::endl; - ServerInstance->QuickExit(EXIT_STATUS_SOCKETENGINE); - } + InitError(); } void SocketEngine::RecoverFromFork() |
