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

From: Chris Down <chris_AT_chrisdown.name>
Date: Wed, 27 Jul 2022 15:14:23 +0100

NRK writes:
>If I understand the manpage correctly, then this patch looks mostly
>okay. Only issue I can think of is that both `sigfillset` and
>`sigprocmask` manpage states that they may return -1 on errors. So
>perhaps they should be error checked just in case:
> if (sigfillset(&sm) < 0 || sigprocmask(SIG_SETMASK, &sm, &oldsm) < 0)
> die("error:");
> /* do the reaping and sighandler installation */
> if (sigprocmask(SIG_SETMASK, &oldsm, NULL) < 0)
> die("error:");

sigfillset() doesn't return errors in POSIX. glibc returns -1/EINVAL if the set
given is NULL, but it isn't here.

sigprocmask() only returns an error if you pass an invalid first argument, but
we're using SIG_SETMASK as part of the userspace ABI contract, so that doesn't
seem very relevant.

Is there some other error you were thinking of?
Received on Wed Jul 27 2022 - 16:14:23 CEST

This archive was generated by hypermail 2.3.0 : Wed Jul 27 2022 - 16:24:30 CEST