From: Daniel Mehrmann Date: Mon, 5 Jul 2004 20:32:00 +0000 (+0000) Subject: In debugMode we use now the file xboard.debug instead of stderr X-Git-Tag: v4.2.8~23 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=2905b78ee65cf49268f6b4d2293613347ac3cb10;p=xboard.git In debugMode we use now the file xboard.debug instead of stderr --- diff --git a/xboard.c b/xboard.c index af116f0..1e009fa 100644 --- a/xboard.c +++ b/xboard.c @@ -1907,7 +1907,15 @@ main(argc, argv) XtGetApplicationResources(shellWidget, (XtPointer) &appData, clientResources, XtNumber(clientResources), NULL, 0); - + + if (appData.debugMode) { + if ((debugFP = fopen("xboard.debug", "w")) == NULL) { + printf(_("Failed to open file xboard.debug \n")); + exit(errno); + } + setbuf(debugFP, NULL); + } + #if !HIGHDRAG /* This feature does not work; animation needs a rewrite */ appData.highlightDragging = FALSE; @@ -2553,6 +2561,8 @@ XBoard square size (hint): %d\n\ } XtAppMainLoop(appContext); + if (appData.debugMode) fclose(debugFP); + return 0; }