diff options
author | Tiago Cunha <tcunha@gmx.com> | 2010-10-24 00:45:57 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2010-10-24 00:45:57 +0000 |
commit | d4b58c71a21b1f380612eb0e45b312e4c91e2a95 (patch) | |
tree | 3250dd46942f127d5faf97e8a5bfc196f54a6dbc /cmd-pipe-pane.c | |
parent | 5fb4f8c1fa3e2a21be846f4fe13c4f6919ff54b2 (diff) | |
download | rtmux-d4b58c71a21b1f380612eb0e45b312e4c91e2a95.tar.gz rtmux-d4b58c71a21b1f380612eb0e45b312e4c91e2a95.tar.bz2 rtmux-d4b58c71a21b1f380612eb0e45b312e4c91e2a95.zip |
Sync OpenBSD patchset 775:
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 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd-pipe-pane.c b/cmd-pipe-pane.c index 85ff2d69..e6fe2c21 100644 --- a/cmd-pipe-pane.c +++ b/cmd-pipe-pane.c @@ -1,4 +1,4 @@ -/* $Id: cmd-pipe-pane.c,v 1.14 2010-08-29 14:42:11 tcunha Exp $ */ +/* $Id: cmd-pipe-pane.c,v 1.15 2010-10-24 00:45:57 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -111,6 +111,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); @@ -129,8 +131,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); } } |