Re: [hackers] [st][PATCH] replace exit(3) by _exit(2) in signal handler sigchld()

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Thu, 30 Apr 2020 01:22:16 +0200

On Thu, Apr 30, 2020 at 12:10:02AM +0200, Jan Klemkow wrote:
> exit(3) is not async-signal-safe but, _exit(2) is.
> This change prevents st to crash and dump core.
> ---
> st.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/st.c b/st.c
> index 0ce6ac2..2bf133f 100644
> --- a/st.c
> +++ b/st.c
> _AT_@ -730,7 +730,7 @@ sigchld(int a)
> die("child exited with status %d\n", WEXITSTATUS(stat));
> else if (WIFSIGNALED(stat))
> die("child terminated due to signal %d\n", WTERMSIG(stat));
> - exit(0);
> + _exit(0);
> }
>
> void
> --
> 2.24.1
>
>

Thanks!

-- 
Kind regards,
Hiltjo
Received on Thu Apr 30 2020 - 01:22:16 CEST

This archive was generated by hypermail 2.3.0 : Thu Apr 30 2020 - 01:24:34 CEST