aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac1
-rw-r--r--g10/signal.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index e5bf1bc1a..0c24a4379 100644
--- a/configure.ac
+++ b/configure.ac
@@ -946,6 +946,7 @@ AC_C_INLINE
AC_C_VOLATILE
AC_TYPE_SIZE_T
AC_TYPE_MODE_T
+AC_CHECK_FUNCS([sigdescr_np])
AC_TYPE_SIGNAL
AC_DECL_SYS_SIGLIST
diff --git a/g10/signal.c b/g10/signal.c
index 44b863d1c..05f09e23f 100644
--- a/g10/signal.c
+++ b/g10/signal.c
@@ -99,7 +99,12 @@ got_fatal_signal( int sig )
s = log_get_name(); if( s ) write(2, s, strlen(s) );
write(2, ": ", 2 );
-#if HAVE_DECL_SYS_SIGLIST && defined(NSIG)
+#if HAVE_SIGDESCR_NP
+ s = sigdescr_np (sig);
+ if (!s)
+ s = "?";
+ write (2, s, strlen (s));
+#elif HAVE_DECL_SYS_SIGLIST && defined(NSIG)
s = (sig >= 0 && sig < NSIG) ? sys_siglist[sig] : "?";
write (2, s, strlen(s) );
#else