diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2010-10-16 08:31:55 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2010-10-16 08:31:55 +0000 |
commit | f56b4ec2ffa6d5667a3bd86040a1c771c1de33a5 (patch) | |
tree | a06294130e18067eca755eb7e91ad6faa548e55c /cmd-pipe-pane.c | |
parent | 6c42f1a89e16d69d5fe24bb8b3f6b37148cfa308 (diff) |
Trying to set FD_CLOEXEC on every fd is a lost cause, just use
closefrom() before exec.
Diffstat (limited to 'cmd-pipe-pane.c')
-rw-r--r-- | cmd-pipe-pane.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd-pipe-pane.c b/cmd-pipe-pane.c index be6f8e25..d287d3b6 100644 --- a/cmd-pipe-pane.c +++ b/cmd-pipe-pane.c @@ -112,6 +112,8 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmd_ctx *ctx) if (null_fd != STDOUT_FILENO && null_fd != STDERR_FILENO) close(null_fd); + closefrom(STDERR_FILENO + 1); + command = status_replace(c, NULL, data->arg, time(NULL), 0); execl(_PATH_BSHELL, "sh", "-c", command, (char *) NULL); _exit(1); @@ -130,8 +132,6 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmd_ctx *ctx) fatal("fcntl failed"); if (fcntl(wp->pipe_fd, F_SETFL, mode|O_NONBLOCK) == -1) fatal("fcntl failed"); - if (fcntl(wp->pipe_fd, F_SETFD, FD_CLOEXEC) == -1) - fatal("fcntl failed"); return (0); } } |