mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Merge branch 'obsd-master'
This commit is contained in:
		
							
								
								
									
										4
									
								
								client.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								client.c
									
									
									
									
									
								
							@@ -366,7 +366,6 @@ client_main(struct event_base *base, int argc, char **argv, int flags)
 | 
			
		||||
	if (client_exittype == MSG_EXEC) {
 | 
			
		||||
		if (client_flags & CLIENT_CONTROLCONTROL)
 | 
			
		||||
			tcsetattr(STDOUT_FILENO, TCSAFLUSH, &saved_tio);
 | 
			
		||||
		proc_clear_signals(client_proc);
 | 
			
		||||
		client_exec(client_execshell, client_execcmd);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -482,6 +481,8 @@ client_exec(const char *shell, const char *shellcmd)
 | 
			
		||||
		xasprintf(&argv0, "%s", name);
 | 
			
		||||
	setenv("SHELL", shell, 1);
 | 
			
		||||
 | 
			
		||||
	proc_clear_signals(client_proc, 1);
 | 
			
		||||
 | 
			
		||||
	setblocking(STDIN_FILENO, 1);
 | 
			
		||||
	setblocking(STDOUT_FILENO, 1);
 | 
			
		||||
	setblocking(STDERR_FILENO, 1);
 | 
			
		||||
@@ -629,7 +630,6 @@ client_dispatch_wait(struct imsg *imsg)
 | 
			
		||||
		if (datalen == 0 || data[datalen - 1] != '\0')
 | 
			
		||||
			fatalx("bad MSG_SHELL string");
 | 
			
		||||
 | 
			
		||||
		proc_clear_signals(client_proc);
 | 
			
		||||
		client_exec(data, shell_command);
 | 
			
		||||
		/* NOTREACHED */
 | 
			
		||||
	case MSG_DETACH:
 | 
			
		||||
 
 | 
			
		||||
@@ -114,7 +114,7 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmdq_item *item)
 | 
			
		||||
		return (CMD_RETURN_ERROR);
 | 
			
		||||
	case 0:
 | 
			
		||||
		/* Child process. */
 | 
			
		||||
		proc_clear_signals(server_proc);
 | 
			
		||||
		proc_clear_signals(server_proc, 1);
 | 
			
		||||
		sigprocmask(SIG_SETMASK, &oldset, NULL);
 | 
			
		||||
		close(pipe_fd[0]);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								job.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								job.c
									
									
									
									
									
								
							@@ -71,7 +71,7 @@ job_run(const char *cmd, struct session *s, const char *cwd,
 | 
			
		||||
		close(out[1]);
 | 
			
		||||
		return (NULL);
 | 
			
		||||
	case 0:
 | 
			
		||||
		proc_clear_signals(server_proc);
 | 
			
		||||
		proc_clear_signals(server_proc, 1);
 | 
			
		||||
		sigprocmask(SIG_SETMASK, &oldset, NULL);
 | 
			
		||||
 | 
			
		||||
		if (cwd == NULL || chdir(cwd) != 0) {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								proc.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								proc.c
									
									
									
									
									
								
							@@ -240,7 +240,7 @@ proc_set_signals(struct tmuxproc *tp, void (*signalcb)(int))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
proc_clear_signals(struct tmuxproc *tp)
 | 
			
		||||
proc_clear_signals(struct tmuxproc *tp, int defaults)
 | 
			
		||||
{
 | 
			
		||||
	struct sigaction	sa;
 | 
			
		||||
 | 
			
		||||
@@ -260,6 +260,16 @@ proc_clear_signals(struct tmuxproc *tp)
 | 
			
		||||
	signal_del(&tp->ev_sigusr1);
 | 
			
		||||
	signal_del(&tp->ev_sigusr2);
 | 
			
		||||
	signal_del(&tp->ev_sigwinch);
 | 
			
		||||
 | 
			
		||||
	if (defaults) {
 | 
			
		||||
		sigaction(SIGHUP, &sa, NULL);
 | 
			
		||||
		sigaction(SIGCHLD, &sa, NULL);
 | 
			
		||||
		sigaction(SIGCONT, &sa, NULL);
 | 
			
		||||
		sigaction(SIGTERM, &sa, NULL);
 | 
			
		||||
		sigaction(SIGUSR1, &sa, NULL);
 | 
			
		||||
		sigaction(SIGUSR2, &sa, NULL);
 | 
			
		||||
		sigaction(SIGWINCH, &sa, NULL);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct tmuxpeer *
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								server.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								server.c
									
									
									
									
									
								
							@@ -160,7 +160,7 @@ server_start(struct tmuxproc *client, struct event_base *base, int lockfd,
 | 
			
		||||
	close(pair[0]);
 | 
			
		||||
	if (daemon(1, 0) != 0)
 | 
			
		||||
		fatal("daemon failed");
 | 
			
		||||
	proc_clear_signals(client);
 | 
			
		||||
	proc_clear_signals(client, 0);
 | 
			
		||||
	if (event_reinit(base) != 0)
 | 
			
		||||
		fatalx("event_reinit failed");
 | 
			
		||||
	server_proc = proc_start("server");
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								tmux.h
									
									
									
									
									
								
							@@ -1503,7 +1503,7 @@ struct tmuxproc *proc_start(const char *);
 | 
			
		||||
void	proc_loop(struct tmuxproc *, int (*)(void));
 | 
			
		||||
void	proc_exit(struct tmuxproc *);
 | 
			
		||||
void	proc_set_signals(struct tmuxproc *, void(*)(int));
 | 
			
		||||
void	proc_clear_signals(struct tmuxproc *);
 | 
			
		||||
void	proc_clear_signals(struct tmuxproc *, int);
 | 
			
		||||
struct tmuxpeer *proc_add_peer(struct tmuxproc *, int,
 | 
			
		||||
	    void (*)(struct imsg *, void *), void *);
 | 
			
		||||
void	proc_remove_peer(struct tmuxpeer *);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								window.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								window.c
									
									
									
									
									
								
							@@ -933,7 +933,7 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv,
 | 
			
		||||
		sigprocmask(SIG_SETMASK, &oldset, NULL);
 | 
			
		||||
		return (-1);
 | 
			
		||||
	case 0:
 | 
			
		||||
		proc_clear_signals(server_proc);
 | 
			
		||||
		proc_clear_signals(server_proc, 1);
 | 
			
		||||
		sigprocmask(SIG_SETMASK, &oldset, NULL);
 | 
			
		||||
 | 
			
		||||
		if (chdir(wp->cwd) != 0) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user