From: H.G. Muller Date: Thu, 7 Jan 2010 11:52:17 +0000 (+0100) Subject: Allow popup-less (fatal) exit of engine after tellusererror X-Git-Tag: master-20100118~23 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=dd050aef7bb911900c308e708c63f5b7006f9c0a;p=xboard.git Allow popup-less (fatal) exit of engine after tellusererror --- diff --git a/backend.c b/backend.c index d062185..4904638 100644 --- a/backend.c +++ b/backend.c @@ -5796,6 +5796,8 @@ HandleMachineMove(message, cps) int machineWhite; char *bookHit; + cps->userError = 0; + FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book hit /* * Kludge to ignore BEL characters @@ -6468,6 +6470,7 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats. return; } if (!strncmp(message, "tellusererror ", 14)) { + cps->userError = 1; DisplayError(message + 14, 0); return; } @@ -12422,7 +12425,7 @@ SendToProgram(message, cps) } gameInfo.resultDetails = StrSave(buf); } - DisplayFatalError(buf, error, 1); + if(!cps->userError || !appData.popupExitMessage) DisplayFatalError(buf, error, 1); else errorExitStatus = 1; } } @@ -12454,7 +12457,7 @@ ReceiveFromProgram(isr, closure, message, count, error) gameInfo.resultDetails = StrSave(buf); } RemoveInputSource(cps->isr); - DisplayFatalError(buf, 0, 1); + if(!cps->userError || !appData.popupExitMessage) DisplayFatalError(buf, 0, 1); else errorExitStatus = 1; } else { sprintf(buf, _("Error reading from %s chess program (%s)"), @@ -12467,7 +12470,7 @@ ReceiveFromProgram(isr, closure, message, count, error) cps->pr = NoProc; } - DisplayFatalError(buf, error, 1); + if(!cps->userError || !appData.popupExitMessage) DisplayFatalError(buf, error, 1); else errorExitStatus = 1; } return; } diff --git a/backend.h b/backend.h index 26a61f6..f86410c 100644 --- a/backend.h +++ b/backend.h @@ -345,6 +345,7 @@ typedef struct _CPS { char *optionSettings; void *programLogo; /* [HGM] logo: bitmap of the logo */ char *fenOverride; /* [HGM} FRC: force FEN casling & ep fields by hand */ + char userError; /* [HGM] crash: flag to suppress fatal-error messages*/ } ChessProgramState; extern ChessProgramState first, second; @@ -370,5 +371,6 @@ extern ChessProgramStats_Move pvInfoList[MAX_MOVES]; extern int shuffleOpenings; extern ChessProgramStats programStats; extern int opponentKibitzes; // used by wengineo.c +extern int errorExitStatus; #endif /* _BACKEND */ diff --git a/winboard/winboard.c b/winboard/winboard.c index 7c8142c..bf23768 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -6065,6 +6065,7 @@ ErrorPopDown() if (errorDialog == NULL) return; DestroyWindow(errorDialog); errorDialog = NULL; + if(errorExitStatus) ExitEvent(errorExitStatus); } LRESULT CALLBACK