aboutsummaryrefslogtreecommitdiff
path: root/tmux.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2010-10-24 00:45:57 +0000
committerTiago Cunha <tcunha@gmx.com>2010-10-24 00:45:57 +0000
commitd4b58c71a21b1f380612eb0e45b312e4c91e2a95 (patch)
tree3250dd46942f127d5faf97e8a5bfc196f54a6dbc /tmux.c
parent5fb4f8c1fa3e2a21be846f4fe13c4f6919ff54b2 (diff)
downloadrtmux-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 'tmux.c')
-rw-r--r--tmux.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tmux.c b/tmux.c
index 726635d2..49fba2ba 100644
--- a/tmux.c
+++ b/tmux.c
@@ -1,4 +1,4 @@
-/* $Id: tmux.c,v 1.217 2010-10-24 00:31:57 tcunha Exp $ */
+/* $Id: tmux.c,v 1.218 2010-10-24 00:45:57 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -226,6 +226,8 @@ shell_exec(const char *shell, const char *shellcmd)
xasprintf(&argv0, "%s", shellname);
setenv("SHELL", shell, 1);
+ closefrom(STDERR_FILENO + 1);
+
execl(shell, argv0, "-c", shellcmd, (char *) NULL);
fatal("execl failed");
}