mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
Trying to set FD_CLOEXEC on every fd is a lost cause, just use
closefrom() before exec.
This commit is contained in:
4
window.c
4
window.c
@ -573,6 +573,8 @@ window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell,
|
||||
if (tcsetattr(STDIN_FILENO, TCSANOW, &tio2) != 0)
|
||||
fatal("tcgetattr failed");
|
||||
|
||||
closefrom(STDERR_FILENO + 1);
|
||||
|
||||
environ_push(env);
|
||||
|
||||
clear_signals(1);
|
||||
@ -603,8 +605,6 @@ window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell,
|
||||
fatal("fcntl failed");
|
||||
if (fcntl(wp->fd, F_SETFL, mode|O_NONBLOCK) == -1)
|
||||
fatal("fcntl failed");
|
||||
if (fcntl(wp->fd, F_SETFD, FD_CLOEXEC) == -1)
|
||||
fatal("fcntl failed");
|
||||
wp->event = bufferevent_new(wp->fd,
|
||||
window_pane_read_callback, NULL, window_pane_error_callback, wp);
|
||||
bufferevent_enable(wp->event, EV_READ|EV_WRITE);
|
||||
|
Reference in New Issue
Block a user