]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/socketengines/socketengine_kqueue.cpp
m_sasl: don't allow AUTHENTICATE with mechanisms with a space
[user/henk/code/inspircd.git] / src / socketengines / socketengine_kqueue.cpp
index 5dd653363947151c313068efdaec6da39dbc688c..8694a0bdd84d4cc2e5249aba5fa4d3f3ed6f5732 100644 (file)
@@ -27,7 +27,7 @@
 #include "socketengine.h"
 #include <iostream>
 
-/** A specialisation of the SocketEngine class, designed to use FreeBSD kqueue().
+/** A specialisation of the SocketEngine class, designed to use BSD kqueue().
  */
 class KQueueEngine : public SocketEngine
 {
@@ -63,14 +63,18 @@ KQueueEngine::KQueueEngine()
        size_t len;
 
        mib[0] = CTL_KERN;
+#ifdef KERN_MAXFILESPERPROC
        mib[1] = KERN_MAXFILESPERPROC;
+#else
+       mib[1] = KERN_MAXFILES;
+#endif
        len = sizeof(MAX_DESCRIPTORS);
        sysctl(mib, 2, &MAX_DESCRIPTORS, &len, NULL, 0);
        if (MAX_DESCRIPTORS <= 0)
        {
                ServerInstance->Logs->Log("SOCKET", DEFAULT, "ERROR: Can't determine maximum number of open sockets!");
                std::cout << "ERROR: Can't determine maximum number of open sockets!" << std::endl;
-               ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE);
+               ServerInstance->QuickExit(EXIT_STATUS_SOCKETENGINE);
        }
 
        this->RecoverFromFork();
@@ -93,7 +97,7 @@ void KQueueEngine::RecoverFromFork()
                ServerInstance->Logs->Log("SOCKET",DEFAULT, "ERROR: this is a fatal error, exiting now.");
                std::cout << "ERROR: Could not initialize socket engine. Your kernel probably does not have the proper features." << std::endl;
                std::cout << "ERROR: this is a fatal error, exiting now." << std::endl;
-               ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE);
+               ServerInstance->QuickExit(EXIT_STATUS_SOCKETENGINE);
        }
        CurrentSetSize = 0;
 }