From f85e55f840853d497225d32a54187543c812101a Mon Sep 17 00:00:00 2001 From: GasparVardanyan Date: Sun, 1 Sep 2024 22:27:50 +0400 Subject: [PATCH] fix the spawnscratch function --- dwm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dwm.c b/dwm.c index ee2ce3f..be6a754 100644 --- a/dwm.c +++ b/dwm.c @@ -1675,10 +1675,18 @@ spawn(const Arg *arg) void spawnscratch(const Arg *arg) { + struct sigaction sa; + if (fork() == 0) { if (dpy) close(ConnectionNumber(dpy)); setsid(); + + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + sa.sa_handler = SIG_DFL; + sigaction(SIGCHLD, &sa, NULL); + execvp(((char **)arg->v)[1], ((char **)arg->v)+1); fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[1]); perror(" failed");