1
0

proj/intercept.c: Append to log file when logging to file

This commit is contained in:
2025-05-05 15:15:04 +02:00
parent faac51bb7f
commit 60143b191e

View File

@@ -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;