diff options
-rw-r--r-- | src/posix/signalHandler.hpp | 12 | ||||
-rw-r--r-- | src/signalController.cpp | 2 | ||||
-rw-r--r-- | src/signalController.h | 5 | ||||
-rw-r--r-- | src/win32/signalHandler.hpp | 10 | ||||
-rw-r--r-- | src/win32/winService.cpp | 2 |
5 files changed, 15 insertions, 16 deletions
diff --git a/src/posix/signalHandler.hpp b/src/posix/signalHandler.hpp index 2b4f8f6..8b3494e 100644 --- a/src/posix/signalHandler.hpp +++ b/src/posix/signalHandler.hpp @@ -37,37 +37,37 @@ #include <boost/thread.hpp> #include <boost/bind.hpp> -int SigIntHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int SigIntHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "SIG-Int caught, exiting"; return 1; } -int SigQuitHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int SigQuitHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "SIG-Quit caught, exiting"; return 1; } -int SigHupHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int SigHupHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "SIG-Hup caught"; return 0; } -int SigTermHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int SigTermHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "SIG-Term caught, exiting"; return 1; } -int SigUsr1Handler(const SigNum& /*sig*/, const std::string& /*msg*/) +int SigUsr1Handler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "SIG-Usr1 caught"; return 0; } -int SigUsr2Handler(const SigNum& /*sig*/, const std::string& /*msg*/) +int SigUsr2Handler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "SIG-Usr2 caught"; return 0; diff --git a/src/signalController.cpp b/src/signalController.cpp index c690608..f20b695 100644 --- a/src/signalController.cpp +++ b/src/signalController.cpp @@ -53,7 +53,7 @@ SignalController& SignalController::instance() return *inst; } -int SigErrorHandler(const SigNum& /*sig*/, const std::string& msg) +int SigErrorHandler(int /*sig*/, const std::string& msg) { AnytunError::throwErr() << msg; diff --git a/src/signalController.h b/src/signalController.h index 7acf4a3..fdc778a 100644 --- a/src/signalController.h +++ b/src/signalController.h @@ -48,8 +48,7 @@ typedef void DaemonService; #define SIGERROR -1 #define SIGUNKNOWN -2 -typedef int SigNum; -typedef boost::function<int (SigNum const&, std::string const&)> SignalHandler; +typedef boost::function<int (int, std::string const&)> SignalHandler; typedef enum { CALLB_RUNNING, CALLB_STOPPING } CallbackType; typedef boost::function<void ()> ServiceCallback; @@ -84,7 +83,7 @@ private: Mutex sigQueueMutex; Semaphore sigQueueSem; - typedef std::map<SigNum, SignalHandler> HandlerMap; + typedef std::map<int, SignalHandler> HandlerMap; HandlerMap handler; typedef std::map<CallbackType, ServiceCallback> CallbackMap; CallbackMap callbacks; diff --git a/src/win32/signalHandler.hpp b/src/win32/signalHandler.hpp index aeafcb4..fb0c7e6 100644 --- a/src/win32/signalHandler.hpp +++ b/src/win32/signalHandler.hpp @@ -35,31 +35,31 @@ #include <windows.h> -int CtrlCHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int CtrlCHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "CTRL-C Event received, exitting"; return 1; } -int CtrlBreakHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int CtrlBreakHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "CTRL-Break Event received, ignoring"; return 0; } -int CtrlCloseHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int CtrlCloseHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "Close Event received, exitting"; return 1; } -int CtrlLogoffHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int CtrlLogoffHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "LogOff Event received, exitting"; return 1; } -int CtrlShutdownHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int CtrlShutdownHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "Shutdown Event received, exitting"; return 1; diff --git a/src/win32/winService.cpp b/src/win32/winService.cpp index 4e324b2..f796fcf 100644 --- a/src/win32/winService.cpp +++ b/src/win32/winService.cpp @@ -130,7 +130,7 @@ VOID WINAPI WinService::ctrlHandler(DWORD dwCtrl) gSignalController.inject(dwCtrl);
}
-int WinService::handleCtrlSignal(const SigNum& sig, const std::string& msg)
+int WinService::handleCtrlSignal(int sig, const std::string& msg)
{
switch(sig) {
case SERVICE_CONTROL_STOP: {
|