Do not close fd 2 if it's the one we need
This should not happen based if stderr was not already closed, but it's better not to make assumptions.
This commit is contained in:
parent
6fece6347f
commit
a8f62a960b
@ -465,6 +465,8 @@ void redirect_stderr(void)
|
||||
exit(1);
|
||||
}
|
||||
dup2(fd, 2);
|
||||
if (fd != 2)
|
||||
close(fd);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user