shod

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 80744f0762e1af81163d34090a5ee791fe5dc433
parent 473940f034d26db0ef0448925b5cb0c6b3fb9e70
Author: Lucas de Sena <lucas@seninha.org>
Date:   Sat, 28 Jan 2023 09:26:19 -0300

fix zombie handling

Thanks to Hiltjo and NRK work on dwm.

Diffstat:
Mshod.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/shod.c b/shod.c @@ -164,10 +164,12 @@ initsignal(void) /* remove zombies, we may inherit children when exec'ing shod in .xinitrc */ sa.sa_handler = SIG_IGN; - sa.sa_flags = 0; + sa.sa_flags = SA_NOCLDSTOP | SA_NOCLDWAIT | SA_RESTART; sigemptyset(&sa.sa_mask); if (sigaction(SIGCHLD, &sa, NULL) == -1) err(1, "sigaction"); + while (waitpid(-1, NULL, WNOHANG) != -1) + ; /* set running to 0 */ sa.sa_handler = siginthandler;