diff options
author | Peter Powell <petpow@saberuk.com> | 2019-12-08 22:27:45 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-12-08 22:27:45 +0000 |
commit | 078f72c1abbd51aaac3ddc32cb79b08bfc6e43c2 (patch) | |
tree | 0d7034f664dc006802165fed2f77328c5edcd399 | |
parent | 98561bddd06d118e5043094bc884593049f37315 (diff) |
Initialise Winsock from inside the socket engine.
-rw-r--r-- | src/inspircd.cpp | 8 | ||||
-rw-r--r-- | src/socketengines/socketengine_select.cpp | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 3c11cc82e..95ddca394 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -441,12 +441,6 @@ InspIRCd::InspIRCd(int argc, char** argv) Exit(EXIT_STATUS_NOERROR); } -#ifdef _WIN32 - // Set up winsock - WSADATA wsadata; - WSAStartup(MAKEWORD(2,2), &wsadata); -#endif - /* Set the finished argument values */ Config->cmdline.nofork = (do_nofork != 0); Config->cmdline.forcedebug = (do_debug != 0); @@ -470,6 +464,8 @@ InspIRCd::InspIRCd(int argc, char** argv) std::cout << con_green << "InspIRCd - Internet Relay Chat Daemon" << con_reset << std::endl; std::cout << "For contributors & authors: " << con_green << "See /INFO Output" << con_reset << std::endl; + + #ifndef _WIN32 if (!do_root) this->CheckRoot(); diff --git a/src/socketengines/socketengine_select.cpp b/src/socketengines/socketengine_select.cpp index 03f0aca62..bfb9ea05c 100644 --- a/src/socketengines/socketengine_select.cpp +++ b/src/socketengines/socketengine_select.cpp @@ -35,6 +35,12 @@ namespace void SocketEngine::Init() { +#ifdef _WIN32 + // Set up winsock. + WSADATA wsadata; + WSAStartup(MAKEWORD(2,2), &wsadata); +#endif + MaxSetSize = FD_SETSIZE; FD_ZERO(&ReadSet); |