[hackers] Re: [dwm][PATCH] Use sigaction(SA_NOCLDWAIT) for SIGCHLD handling

From: NRK <nrk_AT_disroot.org>
Date: Wed, 27 Jul 2022 02:36:02 +0600

On Tue, Jul 26, 2022 at 09:15:30PM +0100, Chris Down wrote:
> - /* clean up any zombies immediately */
> - sigchld(0);
> + if (sigaction(SIGCHLD, &sc, NULL)) {
> + perror("sigaction");
> + exit(EXIT_FAILURE);
> + }

Not too well versed on `sigaction` but what happens to any zombies
*before* the sigaction call? Don't we need to clean those up?

Also `die` already calls perror, could just use:

        if (sigaction(SIGCHLD, &sc, NULL) < 0)
                die("sigaction failed:");

The comparison against 0 is mostly personal, but the suckless coding
style recommends it as well: https://suckless.org/coding_style/

- NRK
Received on Tue Jul 26 2022 - 22:36:02 CEST

This archive was generated by hypermail 2.3.0 : Tue Jul 26 2022 - 22:36:32 CEST