summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);