~martanne/dvtm

e23a7e6292e84b504a01c27dfbf84c5e58d20a1e — Luke Clifton 4 years ago 311a8c0
Don't ignore SIGPIPE in children
1 files changed, 7 insertions(+), 0 deletions(-)

M vt.c
M vt.c => vt.c +7 -0
@@ 1635,6 1635,13 @@ pid_t vt_forkpty(Vt *t, const char *p, const char *argv[], const char *cwd, cons
		if (cwd)
			chdir(cwd);

		struct sigaction sa;
		memset(&sa, 0, sizeof sa);
		sa.sa_flags = 0;
		sigemptyset(&sa.sa_mask);
		sa.sa_handler = SIG_DFL;
		sigaction(SIGPIPE, &sa, NULL);

		execvp(p, (char *const *)argv);
		fprintf(stderr, "\nexecv() failed.\nCommand: '%s'\n", argv[0]);
		exit(1);