Trying to set FD_CLOEXEC on every fd is a lost cause, just use

closefrom() before exec.
This commit is contained in:
Nicholas Marriott
2010-10-16 08:31:55 +00:00
parent 6c42f1a89e
commit f56b4ec2ff
8 changed files with 8 additions and 21 deletions

2
tmux.c
View File

@ -223,6 +223,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");
}