mirror of
https://github.com/tmux/tmux.git
synced 2026-03-06 07:45:35 +00:00
Add pane_pipe_pid with pipe fd and call setpgid to make it easier to kill.
This commit is contained in:
@@ -124,7 +124,7 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmdq_item *item)
|
||||
/* Fork the child. */
|
||||
sigfillset(&set);
|
||||
sigprocmask(SIG_BLOCK, &set, &oldset);
|
||||
switch (fork()) {
|
||||
switch ((wp->pipe_pid = fork())) {
|
||||
case -1:
|
||||
sigprocmask(SIG_SETMASK, &oldset, NULL);
|
||||
cmdq_error(item, "fork error: %s", strerror(errno));
|
||||
@@ -137,6 +137,9 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmdq_item *item)
|
||||
sigprocmask(SIG_SETMASK, &oldset, NULL);
|
||||
close(pipe_fd[0]);
|
||||
|
||||
if (setpgid(0, 0) == -1)
|
||||
_exit(1);
|
||||
|
||||
null_fd = open(_PATH_DEVNULL, O_WRONLY);
|
||||
if (out) {
|
||||
if (dup2(pipe_fd[1], STDIN_FILENO) == -1)
|
||||
|
||||
Reference in New Issue
Block a user