From 2bc8552c79240896ed28926580c9d8aebd5693fe Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Mon, 14 Oct 2013 21:46:46 +0200 Subject: [PATCH] Finally get rid of that highly non-standard use of SIGINT. People will at last be able to Ctrl-C gnushogi :) --- gnushogi/commondsp.c | 2 -- gnushogi/init.c | 2 -- gnushogi/rawdsp.c | 7 ------- xshogi/xshogi.c | 12 +++++------- 4 files changed, 5 insertions(+), 18 deletions(-) diff --git a/gnushogi/commondsp.c b/gnushogi/commondsp.c index 1f39b78..c00338a 100644 --- a/gnushogi/commondsp.c +++ b/gnushogi/commondsp.c @@ -2161,8 +2161,6 @@ InputCommand(char *command) printf("\n"); #endif } - - signal(SIGINT, TerminateSearch); } diff --git a/gnushogi/init.c b/gnushogi/init.c index 74e1744..7b9663b 100644 --- a/gnushogi/init.c +++ b/gnushogi/init.c @@ -1277,8 +1277,6 @@ InitMain(void) if (XSHOGI) { - signal(SIGINT, TerminateSearch); - TCmoves = 40; TCminutes = 5; TCseconds = 0; diff --git a/gnushogi/rawdsp.c b/gnushogi/rawdsp.c index d3f3055..27e558c 100644 --- a/gnushogi/rawdsp.c +++ b/gnushogi/rawdsp.c @@ -315,9 +315,6 @@ Raw_help(void) (TCflag) ? CP[93] : CP[92], TimeControl.moves[black], TimeControl.clock[black] / 100, TCadd/100, MaxSearchDepth); - - signal(SIGINT, Raw_TerminateSearch); - signal(SIGQUIT, Raw_TerminateSearch); } @@ -489,9 +486,6 @@ SetupBoard(void) void Raw_SearchStartStuff(short side) { - signal(SIGINT, Raw_TerminateSearch); - signal(SIGQUIT, Raw_TerminateSearch); - if (flag.post) { printf(CP[123], @@ -969,4 +963,3 @@ Raw_ShowPostnValues(void) mtl[opponent], pscore[opponent], GameType[opponent]); printf("\nhung black %d hung white %d\n", hung[black], hung[white]); } - diff --git a/xshogi/xshogi.c b/xshogi/xshogi.c index 1d998d6..ff2bdc3 100644 --- a/xshogi/xshogi.c +++ b/xshogi/xshogi.c @@ -7130,23 +7130,21 @@ void DisplayTitle(char *title) -/* CHECKME: does this work? - * This routine sends a SIGINT (^C interrupt) to gnushogi to awaken it +/* + * This routine used to send 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 * just by typing a command does not work. * - * In the future, similar code could be used to stop gnushogi and make - * it move immediately when it is thinking about its own move; this could - * be useful if we want to make Backward or ForceMoves work while gnushogi - * is thinking. + * Now gnushogi periodically checks for user input without a need for + * this hack. */ void Attention(int pid) { -#if !defined(FIONREAD) +#if 0 if (localPlayer.appData.noShogiProgram || (pid == 0)) return; -- 1.7.0.4