CRT: close backup stderr file after reset

Close the backup file descriptor of original stderr once it has been
restored at stderr.
This commit is contained in:
Christian Göttsche 2021-09-10 11:26:51 +02:00 committed by BenBE
parent 589b0733d9
commit 38e6136b82

2
CRT.c
View File

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