mirror of
https://github.com/opnsense/src.git
synced 2026-04-15 14:29:58 -04: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
1 changed files with 2 additions and 1 deletions
|
|
@ -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