From 60143b191efee2883020d30bcfccaf2ed8a58f78 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Mon, 5 May 2025 15:15:04 +0200 Subject: [PATCH] proj/intercept.c: Append to log file when logging to file --- proj/intercept/src/intercept.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proj/intercept/src/intercept.c b/proj/intercept/src/intercept.c index fe2a6fc..89606cb 100644 --- a/proj/intercept/src/intercept.c +++ b/proj/intercept/src/intercept.c @@ -887,7 +887,7 @@ static void init(void) { intercept = STDERR_FILENO; mode = 2; } else if (val && strncmp(val, "file:", 5) == 0) { - if ((intercept = open(val + 5, O_CREAT | O_TRUNC | O_WRONLY, 0644)) == -1) { + if ((intercept = open(val + 5, O_CREAT | O_APPEND | O_WRONLY, 0644)) == -1) { fprintf(stderr, "intercept: unable to open log file '%s': %s\n" "intercept: not logging or manipulating function/system calls\n", val + 5, strerror(errno)); errno = 0; mode = -1;