From 8ba33fffe9f496b39ebce9a96258e7ce93384fbe Mon Sep 17 00:00:00 2001 From: Collin Funk via Gnupg-devel Date: Sun, 4 May 2025 11:46:52 -0700 Subject: [PATCH] common: Add Solaris support to get_signal_name. * configure.ac: Check for _sys_siglist. * common/signal.c (get_signal_name): Use _sys_siglist. -- GnuPG-bug-id: 7638 Signed-off-by: Collin Funk --- common/signal.c | 8 ++++++-- configure.ac | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/signal.c b/common/signal.c index d308c175c..a56e6d6f4 100644 --- a/common/signal.c +++ b/common/signal.c @@ -89,8 +89,12 @@ get_signal_name( int signum ) reentrant. */ #if HAVE_SIGDESCR_NP return sigdescr_np (signum); -#elif HAVE_DECL_SYS_SIGLIST && defined(NSIG) - return (signum >= 0 && signum < NSIG) ? sys_siglist[signum] : "?"; +#elif (HAVE_DECL_SYS_SIGLIST || HAVE_DECL__SYS_SIGLIST) && defined(NSIG) +#if HAVE_DECL_SYS_SIGLIST +#undef _sys_siglist +#define _sys_siglist sys_siglist +#endif + return (signum >= 0 && signum < NSIG) ? _sys_siglist[signum] : "?"; #else return NULL; #endif diff --git a/configure.ac b/configure.ac index 1c1c892ca..29aa30973 100644 --- a/configure.ac +++ b/configure.ac @@ -1341,7 +1341,7 @@ fi AC_TYPE_SIZE_T AC_TYPE_MODE_T AC_CHECK_FUNCS([sigdescr_np]) -AC_CHECK_DECLS([sys_siglist],[],[],[#include +AC_CHECK_DECLS([sys_siglist, _sys_siglist],[],[],[#include /* NetBSD declares sys_siglist in unistd.h. */ #ifdef HAVE_UNISTD_H # include