mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
Don't close fd if it's lower then stderr, otherwise we can close
one of the descriptor which we just set. Pointed out by: jilles Approved by: re (hrs)
This commit is contained in:
parent
74bc093c1c
commit
59cf368df4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=301844
|
@ -360,7 +360,8 @@ stdnull(void)
|
|||
if (dup2(fd, STDERR_FILENO) == -1)
|
||||
errx(1, "Unable to cover stderr");
|
||||
|
||||
close(fd);
|
||||
if (fd > STDERR_FILENO)
|
||||
close(fd);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue