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
9cb15c34bc
commit
891559e499
@ -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 New Issue
Block a user