aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2022-07-22 09:18:52 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2022-07-22 09:18:52 +0200
commite03248a4d5feaaacb130416be6e467a04de81f78 (patch)
tree3a6ac9174b9ac4d76813fcd1c086d4381abaf5ae
parent6613d9f9a1a5630bab30bc2b70bdc793977073ee (diff)
Revert "do not call signal-unsafe function inside sighanlder"
This reverts commit 6613d9f9a1a5630bab30bc2b70bdc793977073ee. Discussed on the mailinglist: https://lists.suckless.org/hackers/2207/18405.html
-rw-r--r--dwm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c
index 7c0f978..b3c43ee 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1541,8 +1541,6 @@ setup(void)
Atom utf8string;
/* clean up any zombies immediately */
- if (signal(SIGCHLD, sigchld) == SIG_ERR)
- die("can't install SIGCHLD handler:");
sigchld(0);
/* init screen */
@@ -1640,6 +1638,8 @@ showhide(Client *c)
void
sigchld(int unused)
{
+ if (signal(SIGCHLD, sigchld) == SIG_ERR)
+ die("can't install SIGCHLD handler:");
while (0 < waitpid(-1, NULL, WNOHANG));
}