Browse Source

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>
master
NIIBE Yutaka 3 weeks ago
parent
commit
c4ba712736
  1. 4
      common/signal.c
  2. 1
      configure.ac

4
common/signal.c

@ -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;

1
configure.ac

@ -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

Loading…
Cancel
Save