On Sun, 9 Jan 2022 at 16:48, Warner Losh <i...@bsdimp.com> wrote:
>
> Returns 1 for signals that cause core files.
>
> Signed-off-by: Stacey Son <s...@freebsd.org>
> Signed-off-by: Kyle Evans <kev...@freebsd.org>
> Signed-off-by: Warner Losh <i...@bsdimp.com>
> ---
>  bsd-user/signal.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/bsd-user/signal.c b/bsd-user/signal.c
> index a6e07277fb2..824535be8b8 100644
> --- a/bsd-user/signal.c
> +++ b/bsd-user/signal.c
> @@ -92,6 +92,23 @@ static inline void 
> host_to_target_siginfo_noswap(target_siginfo_t *tinfo,
>      }
>  }
>
> +/* Returns 1 if given signal should dump core if not handled. */
> +static int core_dump_signal(int sig)
> +{
> +    switch (sig) {
> +    case TARGET_SIGABRT:
> +    case TARGET_SIGFPE:
> +    case TARGET_SIGILL:
> +    case TARGET_SIGQUIT:
> +    case TARGET_SIGSEGV:
> +    case TARGET_SIGTRAP:
> +    case TARGET_SIGBUS:
> +        return 1;
> +    default:
> +        return 0;
> +    }
> +}

Code is fine, but since this is a static function with no callers
the compiler is going to emit a warning about that. It's a small
function, so the easiest thing is just to squash this into the
following patch which is what adds the code that calls it.

thanks
-- PMM

Reply via email to