src/common/spawn.c: Restore SIGPIPE default handler before exec

Fixes: #1209
Reported-by: @bdantas
This commit is contained in:
Consolatis 2023-10-29 10:54:44 +01:00
parent 0430f6f818
commit d2c403b84f

View file

@ -46,6 +46,8 @@ spawn_async_no_shell(char const *command)
sigset_t set; sigset_t set;
sigemptyset(&set); sigemptyset(&set);
sigprocmask(SIG_SETMASK, &set, NULL); sigprocmask(SIG_SETMASK, &set, NULL);
/* Restore ignored signals */
signal(SIGPIPE, SIG_DFL);
grandchild = fork(); grandchild = fork();
if (grandchild == 0) { if (grandchild == 0) {
execvp(argv[0], argv); execvp(argv[0], argv);