introduce and use close_on_exec_on(fd). -50 bytes.
This commit is contained in:
@ -576,7 +576,7 @@ static int setup_redirects(struct child_prog *prog, int squirrel[])
|
||||
if (openfd != redir->fd) {
|
||||
if (squirrel && redir->fd < 3) {
|
||||
squirrel[redir->fd] = dup(redir->fd);
|
||||
fcntl(squirrel[redir->fd], F_SETFD, FD_CLOEXEC);
|
||||
close_on_exec_on(squirrel[redir->fd]);
|
||||
}
|
||||
dup2(openfd, redir->fd);
|
||||
close(openfd);
|
||||
|
Reference in New Issue
Block a user