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;