>  void
>  sigchld(int unused)
>  {
> +     if (signal(SIGCHLD, sigchld) == SIG_ERR)
> +             die("can't install SIGCHLD handler:");
>       while (0 < waitpid(-1, NULL, WNOHANG));
>  }

Calling `die` inside a signhandler is still an issue and can produce
bad behavior (I have seen a couple software which randomly freeze due to
calling signal unsafe functions inside a sighandler).

If `sigaction` can fix the issue with `signal` then it's probably best
to use that. Otherwise replacing `die` with `write` and `_exit` is also
a viable solution as shown in: 
https://lists.suckless.org/hackers/2207/18405.html

- NRK

Reply via email to