Re: [PATCH v3 10/10] run-command: block signals between fork and execve
- From
- Brandon Williams <bmwill@google.com>
- Date
- Apr 14, 2017, 20:24 UTC
- Message-ID
- <20170414202447.GC54940@google.com>
- In-Reply-To
- <20170414165902.174167-11-bmwill@google.com>
On 04/14, Brandon Williams wrote:
Show 6 quoted lines
> /*
> + * restore default signal handlers here, in case
> + * we catch a signal right before execve below
> + */
> + for (sig = 1; sig < NSIG; sig++) {
> + sighandler_t old = signal(sig, SIG_DFL);So sighandler_t doesn't work on macOS. Is there a more portable lib that needs to be included for this to work?
Show 9 quoted lines
> + > + /* ignored signals get reset to SIG_DFL on execve */ > + if (old == SIG_IGN) > + signal(sig, SIG_IGN); > + } > + > + if (sigprocmask(SIG_SETMASK, &as.old, NULL) != 0) > + child_die(CHILD_ERR_SIGPROCMASK); > +
-- Brandon Williams