summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2010-01-19 01:32:32 +0000
committerChristian Pointner <equinox@anytun.org>2010-01-19 01:32:32 +0000
commitcc70eb347209598a85c7b93c842f5b72ea099849 (patch)
treea3c75c1bb9f0f403911ddd36d93aa923394f1645
parentsplitted signalController and SignalHandlers (diff)
fixed signal handler on windows
-rw-r--r--src/signalController.cpp4
-rw-r--r--src/win32/signalHandler.hpp10
2 files changed, 9 insertions, 5 deletions
diff --git a/src/signalController.cpp b/src/signalController.cpp
index d35e785..cc31c75 100644
--- a/src/signalController.cpp
+++ b/src/signalController.cpp
@@ -61,7 +61,11 @@ int SigErrorHandler::handle(const std::string& msg)
}
// use system specific signal handler
+#ifndef _MSC_VER
#include "signalHandler.hpp"
+#else
+#include "win32/signalHandler.hpp"
+#endif
SignalController::~SignalController()
{
diff --git a/src/win32/signalHandler.hpp b/src/win32/signalHandler.hpp
index f272f1c..e844ba8 100644
--- a/src/win32/signalHandler.hpp
+++ b/src/win32/signalHandler.hpp
@@ -101,11 +101,11 @@ void registerSignalHandler(SignalController& ctrl)
if(!SetConsoleCtrlHandler((PHANDLER_ROUTINE)handle, true))
AnytunError::throwErr() << "Error on SetConsoleCtrlhandler: " << AnytunErrno(GetLastError());
- handler[CTRL_C_EVENT] = new CtrlCHandler;
- handler[CTRL_BREAK_EVENT] = new CtrlBreakHandler;
- handler[CTRL_CLOSE_EVENT] = new CtrlCloseHandler;
- handler[CTRL_LOGOFF_EVENT] = new CtrlLogoffHandler;
- handler[CTRL_SHUTDOWN_EVENT] = new CtrlShutdownHandler;
+ ctrl.handler[CTRL_C_EVENT] = new CtrlCHandler;
+ ctrl.handler[CTRL_BREAK_EVENT] = new CtrlBreakHandler;
+ ctrl.handler[CTRL_CLOSE_EVENT] = new CtrlCloseHandler;
+ ctrl.handler[CTRL_LOGOFF_EVENT] = new CtrlLogoffHandler;
+ ctrl.handler[CTRL_SHUTDOWN_EVENT] = new CtrlShutdownHandler;
}
#endif