From 38e6136b82df583ce59ccc580bf5561c52bc85db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 10 Sep 2021 11:26:51 +0200 Subject: [PATCH] CRT: close backup stderr file after reset Close the backup file descriptor of original stderr once it has been restored at stderr. --- CRT.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CRT.c b/CRT.c index 86578c8f..2533f613 100644 --- a/CRT.c +++ b/CRT.c @@ -772,6 +772,8 @@ static void dumpStderr(void) { fsync(STDERR_FILENO); dup2(stderrRedirectBackupFd, STDERR_FILENO); + close(stderrRedirectBackupFd); + stderrRedirectBackupFd = -1; lseek(stderrRedirectNewFd, 0, SEEK_SET); bool header = false;