diff options
| author | 2017-10-22 03:10:48 +0100 | |
|---|---|---|
| committer | 2017-10-22 19:45:05 +0100 | |
| commit | 63e300ed082b82530ad5ae0949f45686746b7c9b (patch) | |
| tree | 652448c5c2bd134df654b49b3aec7d82899abf64 /src/socketengine.cpp | |
| parent | Convert GetMaxFds() to size_t and deduplicate setting code. (diff) | |
Deduplicate error handling in the socket engines.
Diffstat (limited to 'src/socketengine.cpp')
| -rw-r--r-- | src/socketengine.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/socketengine.cpp b/src/socketengine.cpp index bac97a6dc..58e15af44 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -21,8 +21,11 @@ */ +#include "exitcodes.h" #include "inspircd.h" +#include <iostream> + /** Reference table, contains all current handlers **/ std::vector<EventHandler*> SocketEngine::ref; @@ -60,6 +63,12 @@ void EventHandler::OnEventHandlerError(int errornum) { } +void SocketEngine::InitError() +{ + std::cerr << con_red << "FATAL ERROR!" << con_reset << " Socket engine initialization failed. " << strerror(errno) << '.' << std::endl; + ServerInstance->QuickExit(EXIT_STATUS_SOCKETENGINE); +} + void SocketEngine::LookupMaxFds() { struct rlimit limits; |
