From 63e300ed082b82530ad5ae0949f45686746b7c9b Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 22 Oct 2017 03:10:48 +0100 Subject: Deduplicate error handling in the socket engines. --- src/socketengine.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/socketengine.cpp') 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 + /** Reference table, contains all current handlers **/ std::vector 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; -- cgit v1.3.1-10-gc9f91