summaryrefslogtreecommitdiffstats
path: root/CRT.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-09-10 11:26:51 +0200
committerBenBE <BenBE@geshi.org>2021-09-10 17:01:26 +0200
commit38e6136b82df583ce59ccc580bf5561c52bc85db (patch)
treeceecf0164f5d68f3e4abe3d4ba962f15c331f7d2 /CRT.c
parent589b0733d993ec7eaa44096de953b172f8b0d573 (diff)
CRT: close backup stderr file after reset
Close the backup file descriptor of original stderr once it has been restored at stderr.
Diffstat (limited to 'CRT.c')
-rw-r--r--CRT.c2
1 files changed, 2 insertions, 0 deletions
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;

© 2014-2024 Faster IT GmbH | imprint | privacy policy