die() calls vprintf, fputc and exit; none of these are
async-signal-safe, see `man 7 signal-safety`.
Atom utf8string;
/* clean up any zombies immediately */
+ if (signal(SIGCHLD, sigchld) == SIG_ERR)
+ die("can't install SIGCHLD handler:");
sigchld(0);
/* init screen */
void
sigchld(int unused)
{
- if (signal(SIGCHLD, sigchld) == SIG_ERR)
- die("can't install SIGCHLD handler:");
while (0 < waitpid(-1, NULL, WNOHANG));
}