Make UCI2WB resistent to SIGTERM in Linux
authorH.G.Muller <hgm@hgm-xboard.(none)>
Wed, 29 Oct 2014 21:43:46 +0000 (22:43 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Wed, 29 Oct 2014 21:43:46 +0000 (22:43 +0100)
UCI2WB was already resistant to SIGINT, which XBoard sends with every
usermove, but must also ignore the SIGTERM that is sent with the quit
command in order to reliably relay this quit to the engine.

UCI2WB.c

index 53d130f..7aaad84 100644 (file)
--- a/UCI2WB.c
+++ b/UCI2WB.c
@@ -604,7 +604,7 @@ main(int argc, char **argv)
 #ifdef WIN32\r
        CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) Engine2GUI, (LPVOID) NULL, 0, &thread_id);\r
 #else\r
-        { pthread_t t; signal(SIGINT, SIG_IGN); pthread_create(&t, NULL, Engine2GUI, NULL); }\r
+        { pthread_t t; signal(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); pthread_create(&t, NULL, Engine2GUI, NULL); }\r
 #endif\r
 \r
        // handle GUI->engine traffic in original thread\r