~kaction/dvtm

e07210917bb74d343648cd64ea231da258c581de — Luke Clifton 2 years ago 02b4567
Don't ignore SIGPIPE in children
1 files changed, 7 insertions(+), 0 deletions(-)

M vt.c
M vt.c => vt.c +7 -0
@@ 1643,6 1643,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);