From 2fe8bdb5a47b0258bae9d7893bef50b2f50afc5c Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 19 Jul 2007 21:48:45 +0000 Subject: Whoops, someone forgot to check the return value when initializing windows IOCP git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7476 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/socketengine_iocp.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/socketengine_iocp.cpp b/src/socketengine_iocp.cpp index 0f1e7e9af..b856ebdf8 100644 --- a/src/socketengine_iocp.cpp +++ b/src/socketengine_iocp.cpp @@ -19,6 +19,15 @@ IOCPEngine::IOCPEngine(InspIRCd * Instance) : SocketEngine(Instance) /* Create completion port */ m_completionPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, (ULONG_PTR)0, 0); + if (m_completionPort == -1) + { + ServerInstance->Log(SPARSE,"ERROR: Could not initialize socket engine. Your kernel probably does not have the proper features."); + ServerInstance->Log(SPARSE,"ERROR: this is a fatal error, exiting now."); + printf("ERROR: Could not initialize socket engine. Your kernel probably does not have the proper features."); + printf("ERROR: this is a fatal error, exiting now."); + InspIRCd::Exit(EXIT_STATUS_SOCKETENGINE); + } + /* Null variables out. */ CurrentSetSize = 0; EngineHandle = 0; -- cgit v1.2.3