]> git.gag.com Git - fw/openocd/blobdiff - src/server/server.c
- added support for Asix Presto JTAG interface (thanks to Pavel Chromy and Asix for...
[fw/openocd] / src / server / server.c
index ac5e17e56981a4fc8835929b85b69259fd5fba0b..4c4fdecccd1972b203ec9a2c9ac262879680915b 100644 (file)
@@ -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