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:
Vincent Penquerc'h 2014-02-15 07:04:51 -05:00 committed by Marek Marczykowski-Górecki
parent 6fece6347f
commit a8f62a960b

View File

@ -465,6 +465,8 @@ void redirect_stderr(void)
exit(1);
}
dup2(fd, 2);
if (fd != 2)
close(fd);
}