[FFmpeg-devel] [PATCH 1/2] ffmpeg: use sigaction() instead of signal() on linux

Zane van Iperen zane at zanevaniperen.com
Sun Jan 10 18:32:46 EET 2021


On 29/11/20 5:46 am, Andriy Gelman wrote:

>   void term_init(void)
>   {
> +#if defined __linux__
> +    struct sigaction action;

Nit: Should this have a "= {0}"?

My sigaction(2) says:
   On some architectures a union is involved: do not assign to both sa_handler and sa_sigaction.
so it's possible that sa_sigaction is left uninitialised.

If I'm wrong (quite possible, it's 2am), then part 1 lgtm.

> +    action.sa_handler = sigterm_handler;
> +
> +    /* block other interrupts while processing this one */
> +    sigfillset(&action.sa_mask);
> +
> +    /* restart interruptible functions (i.e. don't fail with EINTR)  */
> +    action.sa_flags = SA_RESTART;
> +#endif


More information about the ffmpeg-devel mailing list