[PATCH gnupg] common: Add Solaris support to get_signal_name.

Collin Funk via Gnupg-devel <[email protected]>
Newsgroups gmane.comp.encryption.gpg.devel
Message-ID <[email protected]>
* configure.ac: Check for _sys_siglist.
* common/signal.c (get_signal_name): Use _sys_siglist.

--

GnuPG-bug-id: 7638
Signed-off-by: Collin Funk <[email protected]>
---
 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 <signal.h>
+AC_CHECK_DECLS([sys_siglist, _sys_siglist],[],[],[#include <signal.h>
 /* NetBSD declares sys_siglist in unistd.h.  */
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
-- 
2.49.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.