aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2023-06-15 23:57:16 -0500
committerLeonardo Hernández <leohdz172@proton.me>2023-06-16 00:24:17 -0600
commit9c592da01f7648ff1efb69e851ced554b3231096 (patch)
tree501970d8b596c64c48631ad9706025eda1a48ad2
parentdf11b7a7864b416bba52e00d6ad7997d9a7c19b0 (diff)
Reset ignored signal handler in spawn() as well
-rw-r--r--dwl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dwl.c b/dwl.c
index 19adafe..9402935 100644
--- a/dwl.c
+++ b/dwl.c
@@ -2327,6 +2327,9 @@ void
spawn(const Arg *arg)
{
if (fork() == 0) {
+ struct sigaction sa = {.sa_flags = SA_RESTART, .sa_handler = SIG_DFL};
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGCHLD, &sa, NULL);
dup2(STDERR_FILENO, STDOUT_FILENO);
setsid();
execvp(((char **)arg->v)[0], (char **)arg->v);