diff options
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/server.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/server/server.c b/src/server/server.c index ac5e17e..4c4fdec 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -382,6 +382,12 @@ int server_loop(command_context_t *command_context) shutdown_openocd = 1; } } +#else + MSG msg; + while (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) + { + if (msg.message==WM_QUIT) shutdown_openocd = 1; + } #endif } @@ -394,6 +400,10 @@ BOOL WINAPI ControlHandler(DWORD dwCtrlType) shutdown_openocd = 1; return TRUE; } + +void sig_handler(int sig) { + shutdown_openocd = 1; +} #endif int server_init() @@ -411,6 +421,11 @@ int server_init() } SetConsoleCtrlHandler( ControlHandler, TRUE ); + + signal(SIGINT, sig_handler); + signal(SIGTERM, sig_handler); + signal(SIGBREAK, sig_handler); + signal(SIGABRT, sig_handler); #endif |