1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

common: Fix get_signal_name for GNU/Linux.

* common/signal.c (get_signal_name): Use sigdescr_np if available.
* configure.ac: Check the function.

--

GnuPG-bug-id: 5568
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2021-08-26 14:22:19 +09:00
parent 5f045c24ff
commit c4ba712736
2 changed files with 4 additions and 1 deletions

View File

@ -87,7 +87,9 @@ get_signal_name( int signum )
{
/* Note that we can't use strsignal(), because it is not
reentrant. */
#if HAVE_DECL_SYS_SIGLIST && defined(NSIG)
#if HAVE_SIGDESCR_NP
return sigdescr_np (signum);
#elif HAVE_DECL_SYS_SIGLIST && defined(NSIG)
return (signum >= 0 && signum < NSIG) ? sys_siglist[signum] : "?";
#else
return NULL;

View File

@ -1373,6 +1373,7 @@ AC_C_INLINE
AC_C_VOLATILE
AC_TYPE_SIZE_T
AC_TYPE_MODE_T
AC_CHECK_FUNCS([sigdescr_np])
AC_CHECK_DECLS([sys_siglist],[],[],[#include <signal.h>
/* NetBSD declares sys_siglist in unistd.h. */
#ifdef HAVE_UNISTD_H