diff options
author | NRK <nrk@disroot.org> | 2022-07-14 07:26:40 +0600 |
---|---|---|
committer | rafa_99 <raroma09@gmail.com> | 2022-07-16 16:25:43 +0100 |
commit | 2cff816768b35933da6e1a7360b37e660bc5f37b (patch) | |
tree | 16b2245a071a2a782a43f50ec64d1cea71fd57fd /dwm.c | |
parent | 8cde91d76ee62d3347edc72047f1e5277feacb4b (diff) |
do not call signal-unsafe function inside sighanlder
die() calls vprintf, fputc and exit; none of these are
async-signal-safe, see `man 7 signal-safety`.
Diffstat (limited to 'dwm.c')
-rw-r--r-- | dwm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1726,6 +1726,8 @@ setup(void) Atom utf8string; /* clean up any zombies immediately */ + if (signal(SIGCHLD, sigchld) == SIG_ERR) + die("can't install SIGCHLD handler:"); sigchld(0); signal(SIGHUP, sighup); @@ -1830,8 +1832,6 @@ 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)); } |