1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-11-04 20:38:50 +01:00

gpg: Use sigdescr_np for newer GNU C library.

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

--

Backport master commit of:
	c4ba712736

GnuPG-bug-id: 5568
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2021-08-27 09:03:58 +09:00
parent c8ad567e7c
commit 467f057ad1
2 changed files with 7 additions and 1 deletions

View File

@ -946,6 +946,7 @@ AC_C_INLINE
AC_C_VOLATILE AC_C_VOLATILE
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
AC_TYPE_MODE_T AC_TYPE_MODE_T
AC_CHECK_FUNCS([sigdescr_np])
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
AC_DECL_SYS_SIGLIST AC_DECL_SYS_SIGLIST

View File

@ -99,7 +99,12 @@ got_fatal_signal( int sig )
s = log_get_name(); if( s ) write(2, s, strlen(s) ); s = log_get_name(); if( s ) write(2, s, strlen(s) );
write(2, ": ", 2 ); 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] : "?"; s = (sig >= 0 && sig < NSIG) ? sys_siglist[sig] : "?";
write (2, s, strlen(s) ); write (2, s, strlen(s) );
#else #else