Restore SIGINT for stopping gnushogi when thinking.
authorYann Dirson <ydirson@free.fr>
Sun, 13 Oct 2013 21:25:42 +0000 (23:25 +0200)
committerYann Dirson <ydirson@free.fr>
Mon, 14 Oct 2013 18:44:51 +0000 (20:44 +0200)
SIGINT is unfortunately part of the protocol inherited from gnuchess4,
and is used by xboard as such.  So this was not a proper fix for the
original issue.

This reverts commit 00e10bc4a760150665436b17c50abf264f28d435,
"Don't intercept INT and QUIT signals, and use USR1 instead of QUIT for".

gnushogi/commondsp.c
gnushogi/init.c
gnushogi/rawdsp.c
xshogi/xshogi.c

index db90fd3..31dc80e 100644 (file)
@@ -2162,7 +2162,7 @@ InputCommand(char *command)
 #endif
     }
 
-    signal(SIGUSR1, TerminateSearch);
+    signal(SIGINT, TerminateSearch);
 }
 
 
index b971b7a..74e1744 100644 (file)
@@ -1277,7 +1277,7 @@ InitMain(void)
 
     if (XSHOGI)
     {
-        signal(SIGUSR1, TerminateSearch);
+        signal(SIGINT, TerminateSearch);
 
         TCmoves      = 40;
         TCminutes    = 5;
index 7d17287..2109ca9 100644 (file)
@@ -314,7 +314,8 @@ Raw_help(void)
            TimeControl.moves[black], TimeControl.clock[black] / 100,
            TCadd/100, MaxSearchDepth);
 
-    signal(SIGUSR1, Raw_TerminateSearch);
+    signal(SIGINT, Raw_TerminateSearch);
+    signal(SIGQUIT, Raw_TerminateSearch);
 }
 
 
@@ -486,7 +487,8 @@ SetupBoard(void)
 void
 Raw_SearchStartStuff(short side)
 {
-    signal(SIGUSR1, Raw_TerminateSearch);
+    signal(SIGINT, Raw_TerminateSearch);
+    signal(SIGQUIT, Raw_TerminateSearch);
 
     if (flag.post)
     {
index f6317dd..1d998d6 100644 (file)
@@ -7131,7 +7131,7 @@ void DisplayTitle(char *title)
 
 
 /* CHECKME: does this work?
- * This routine sends a SIGUSR1 to gnushogi to awaken it
+ * This routine sends a SIGINT (^C interrupt) to gnushogi to awaken it
  * if it might be busy thinking on our time.  This normally isn't needed,
  * but is useful on systems where the FIONREAD ioctl doesn't work since
  * on those systems the gnushogi feature that lets you interrupt its thinking
@@ -7159,11 +7159,11 @@ Attention(int pid)
         {
             if (xshogiDebug || localPlayer.appData.debugMode)
             {
-                fprintf(stderr, "Sending SIGUSR1 to %s\n",
+                fprintf(stderr, "Sending SIGINT to %s\n",
                         ((pid == firstProgramPID) ? "first" : "second"));
             }
 
-            (void)kill(pid, SIGUSR1); /* stop it thinking */
+            (void)kill(pid, SIGINT); /* stop it thinking */
         }
         break;