aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-01-16 00:48:41 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2016-01-16 00:48:41 +0100
commit80e14db520023c00ed38c5661341e70260477a12 (patch)
treefd55bc9699d03f69ff4e98a85b56d094017dc5ee
parent959040d1747855da47949960bf41550e9fce5d7e (diff)
downloaddesktop-tools-80e14db520023c00ed38c5661341e70260477a12.tar.gz
desktop-tools-80e14db520023c00ed38c5661341e70260477a12.tar.xz
desktop-tools-80e14db520023c00ed38c5661341e70260477a12.zip
dwmstatus: avoid zombie processes
-rw-r--r--dwmstatus.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/dwmstatus.c b/dwmstatus.c
index afa7def..11c78ef 100644
--- a/dwmstatus.c
+++ b/dwmstatus.c
@@ -2811,6 +2811,14 @@ main (int argc, char *argv[])
opt_handler_free (&oh);
+ // We don't need to retrieve exit statuses of anything, avoid zombies
+ struct sigaction sa;
+ sa.sa_flags = SA_RESTART | SA_NOCLDWAIT;
+ sigemptyset (&sa.sa_mask);
+ sa.sa_handler = SIG_IGN;
+ if (sigaction (SIGCHLD, &sa, NULL) == -1)
+ print_error ("%s: %s", "sigaction", strerror (errno));
+
struct app_context ctx;
app_context_init (&ctx);
ctx.prefix = argc > 1 ? argv[1] : NULL;