summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-10-05 10:43:26 -0700
committerScott Gasch <[email protected]>2026-10-05 10:43:26 -0700
commite5c845d7e0b936641158909dbc516a79958c74e8 (patch)
treeeaa8113b67d21ecea04a2dbae860c7fe0e3b10cd /src
parent64b5d3307a7a95975f7f8c0248f3f1febedd8617 (diff)
Update makefile and logfile to work with linux.
Diffstat (limited to 'src')
-rw-r--r--src/GNUmakefile5
-rw-r--r--src/main.c11
2 files changed, 9 insertions, 7 deletions
diff --git a/src/GNUmakefile b/src/GNUmakefile
index b9b6d16..eb7eb2d 100644
--- a/src/GNUmakefile
+++ b/src/GNUmakefile
@@ -285,7 +285,10 @@ endif
# the PROFILE-overwriting `=` assignments above (not `+=`), so it
# survives into CFLAGS instead of being wiped out by them.
GIT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
-GIT_DIRTY := $(shell git diff --quiet 2>/dev/null || echo -dirty)
+# Scoped to this directory: an unscoped `git diff` has to stat (and,
+# with a stale index, re-hash) every tracked file in the repo,
+# including the multi-GB pgn/twic.pgn, on every make invocation.
+GIT_DIRTY := $(shell git diff --quiet -- . 2>/dev/null || echo -dirty)
# Kept out of PROFILE itself (not folded in via +=): PROFILE gets
# stringified whole into -DPROFILE="..." below for the "Make profile
# used" trace line, and this value's embedded quotes broke that outer
diff --git a/src/main.c b/src/main.c
index f96ba4a..ecc9430 100644
--- a/src/main.c
+++ b/src/main.c
@@ -21,6 +21,7 @@ Revision History:
**/
#include "chess.h"
+#include <errno.h>
FILE *g_pfLogfile = NULL;
GAME_OPTIONS g_Options;
@@ -157,12 +158,10 @@ Return value:
g_pfLogfile = fopen(g_Options.szLogfile, "wb+");
if (NULL == g_pfLogfile) {
- UtilPanic(INITIALIZATION_FAILURE,
- (void *)"Can't open logfile",
- (void *)&(g_Options.szLogfile),
- (void *)"write",
- NULL,
- __FILE__, __LINE__);
+ Trace("WARNING: Can't open logfile %s for write (%s); "
+ "continuing without logging.\n",
+ g_Options.szLogfile, strerror(errno));
+ return(FALSE);
}
return(TRUE);
}