diff options
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; |