diff options
author | Attila Molnar <attilamolnar@hush.com> | 2012-10-14 12:40:52 -0700 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2012-10-14 12:40:52 -0700 |
commit | 336e30f61f9cb04620f5be46189753636f4f9d49 (patch) | |
tree | 944335aad069ebf520772a6a46268bce1879c23b /src/socketengines | |
parent | 81e644a40b7eead5402fe38ccb7f076b54344911 (diff) | |
parent | ebdaf368e137fc933e648ee88a08a4f83e796f87 (diff) |
Merge pull request #338 from ChrisTX/insp20+iostream
Replace printf(_c) with iostream
Diffstat (limited to 'src/socketengines')
-rw-r--r-- | src/socketengines/socketengine_epoll.cpp | 7 | ||||
-rw-r--r-- | src/socketengines/socketengine_kqueue.cpp | 7 | ||||
-rw-r--r-- | src/socketengines/socketengine_poll.cpp | 3 | ||||
-rw-r--r-- | src/socketengines/socketengine_ports.cpp | 7 |
4 files changed, 14 insertions, 10 deletions
diff --git a/src/socketengines/socketengine_epoll.cpp b/src/socketengines/socketengine_epoll.cpp index 79d69698a..f7e107e7b 100644 --- a/src/socketengines/socketengine_epoll.cpp +++ b/src/socketengines/socketengine_epoll.cpp @@ -26,6 +26,7 @@ #include "socketengine.h" #include <sys/epoll.h> #include <ulimit.h> +#include <iostream> #define EP_DELAY 5 /** A specialisation of the SocketEngine class, designed to use linux 2.6 epoll(). @@ -61,7 +62,7 @@ EPollEngine::EPollEngine() else { ServerInstance->Logs->Log("SOCKET", DEFAULT, "ERROR: Can't determine maximum number of open sockets!"); - printf("ERROR: Can't determine maximum number of open sockets!\n"); + std::cout << "ERROR: Can't determine maximum number of open sockets!" << std::endl; ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE); } @@ -72,8 +73,8 @@ EPollEngine::EPollEngine() { ServerInstance->Logs->Log("SOCKET",DEFAULT, "ERROR: Could not initialize socket engine: %s", strerror(errno)); ServerInstance->Logs->Log("SOCKET",DEFAULT, "ERROR: Your kernel probably does not have the proper features. This is a fatal error, exiting now."); - printf("ERROR: Could not initialize epoll socket engine: %s\n", strerror(errno)); - printf("ERROR: Your kernel probably does not have the proper features. This is a fatal error, exiting now.\n"); + std::cout << "ERROR: Could not initialize epoll socket engine: " << strerror(errno) << std::endl; + std::cout << "ERROR: Your kernel probably does not have the proper features. This is a fatal error, exiting now." << std::endl; ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE); } diff --git a/src/socketengines/socketengine_kqueue.cpp b/src/socketengines/socketengine_kqueue.cpp index 63e16ac6e..5dd653363 100644 --- a/src/socketengines/socketengine_kqueue.cpp +++ b/src/socketengines/socketengine_kqueue.cpp @@ -25,6 +25,7 @@ #include <sys/event.h> #include <sys/time.h> #include "socketengine.h" +#include <iostream> /** A specialisation of the SocketEngine class, designed to use FreeBSD kqueue(). */ @@ -68,7 +69,7 @@ KQueueEngine::KQueueEngine() if (MAX_DESCRIPTORS <= 0) { ServerInstance->Logs->Log("SOCKET", DEFAULT, "ERROR: Can't determine maximum number of open sockets!"); - printf("ERROR: Can't determine maximum number of open sockets!\n"); + std::cout << "ERROR: Can't determine maximum number of open sockets!" << std::endl; ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE); } @@ -90,8 +91,8 @@ void KQueueEngine::RecoverFromFork() { ServerInstance->Logs->Log("SOCKET",DEFAULT, "ERROR: Could not initialize socket engine. Your kernel probably does not have the proper features."); ServerInstance->Logs->Log("SOCKET",DEFAULT, "ERROR: this is a fatal error, exiting now."); - printf("ERROR: Could not initialize socket engine. Your kernel probably does not have the proper features.\n"); - printf("ERROR: this is a fatal error, exiting now.\n"); + 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); } CurrentSetSize = 0; diff --git a/src/socketengines/socketengine_poll.cpp b/src/socketengines/socketengine_poll.cpp index dd38c32b9..6a385c8d8 100644 --- a/src/socketengines/socketengine_poll.cpp +++ b/src/socketengines/socketengine_poll.cpp @@ -26,6 +26,7 @@ #ifndef SOCKETENGINE_POLL #define SOCKETENGINE_POLL +#include <iostream> #include <vector> #include <string> #include <map> @@ -92,7 +93,7 @@ PollEngine::PollEngine() else { ServerInstance->Logs->Log("SOCKET", DEFAULT, "ERROR: Can't determine maximum number of open sockets: %s", strerror(errno)); - printf("ERROR: Can't determine maximum number of open sockets: %s\n", strerror(errno)); + std::cout << "ERROR: Can't determine maximum number of open sockets: " << strerror(errno) << std::endl; ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE); } #else diff --git a/src/socketengines/socketengine_ports.cpp b/src/socketengines/socketengine_ports.cpp index 5fc645bb1..9a86c47d0 100644 --- a/src/socketengines/socketengine_ports.cpp +++ b/src/socketengines/socketengine_ports.cpp @@ -36,6 +36,7 @@ #include "inspircd.h" #include "socketengine.h" #include <port.h> +#include <iostream> /** A specialisation of the SocketEngine class, designed to use solaris 10 I/O completion ports */ @@ -75,7 +76,7 @@ PortsEngine::PortsEngine() else { ServerInstance->Logs->Log("SOCKET", DEFAULT, "ERROR: Can't determine maximum number of open sockets!"); - printf("ERROR: Can't determine maximum number of open sockets!\n"); + std::cout << "ERROR: Can't determine maximum number of open sockets!" << std::endl; ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE); } EngineHandle = port_create(); @@ -84,8 +85,8 @@ PortsEngine::PortsEngine() { ServerInstance->Logs->Log("SOCKET",SPARSE,"ERROR: Could not initialize socket engine: %s", strerror(errno)); ServerInstance->Logs->Log("SOCKET",SPARSE,"ERROR: This is a fatal error, exiting now."); - printf("ERROR: Could not initialize socket engine: %s\n", strerror(errno)); - printf("ERROR: This is a fatal error, exiting now.\n"); + std::cout << "ERROR: Could not initialize socket engine: " << strerror(errno) << std::endl; + std::cout << "ERROR: This is a fatal error, exiting now." << std::endl; ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE); } CurrentSetSize = 0; |