diff options
author | Christian Pointner <equinox@anytun.org> | 2009-02-22 07:20:56 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2009-02-22 07:20:56 +0000 |
commit | b7013f1be9a5f09ecae4b37f0986352abfcd0dc1 (patch) | |
tree | f890c7677d27953afaf05215a9c91a86b23897bd /src/signalController.cpp | |
parent | fixed signalController on unix (diff) |
replaced regular throws with AnytunError::thowErr
Diffstat (limited to 'src/signalController.cpp')
-rw-r--r-- | src/signalController.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/signalController.cpp b/src/signalController.cpp index 4e5f8b6..266ef96 100644 --- a/src/signalController.cpp +++ b/src/signalController.cpp @@ -36,6 +36,7 @@ #include "signalController.h" #include "log.h" +#include "anytunError.hpp" #include "threadUtils.hpp" #ifndef _MSC_VER @@ -202,11 +203,8 @@ void SignalController::init() handler[SIGUSR1] = new SigUsr1Handler; handler[SIGUSR2] = new SigUsr2Handler; #else - if(!SetConsoleCtrlHandler((PHANDLER_ROUTINE)SignalController::handle, true)) { - std::stringstream msg; - msg << "Error on SetConsoleCtrlhandler: " << LogErrno(GetLastError()); - throw std::runtime_error(msg.str()); - } + if(!SetConsoleCtrlHandler((PHANDLER_ROUTINE)SignalController::handle, true)) + AnytunError::throwErr() << "Error on SetConsoleCtrlhandler: " << LogErrno(GetLastError()); handler[CTRL_C_EVENT] = new CtrlCHandler; handler[CTRL_BREAK_EVENT] = new CtrlBreakHandler; |