(got_fatal_signal): Print the signal number if we can't

get a name for it.
(get_signal_name): Return NULL if no name is available. Fixed
conditional for sys_siglist to the correct one.
This commit is contained in:
Werner Koch 2005-05-13 12:43:07 +00:00
parent d8718bd67f
commit a5c4c4bf12
2 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,8 @@
* signal.c (got_fatal_signal): Print the signal number if we can't
get a name for it.
(get_signal_name): Return NULL if no name is available.
(get_signal_name): Return NULL if no name is available. Fixed
conditional for sys_siglist to the correct one.
2005-04-17 Werner Koch <wk@g10code.com>

View File

@ -76,7 +76,7 @@ get_signal_name( int signum )
{
/* Note that we can't use strsignal(), because it is not
reentrant. */
#if defined(SYS_SIGLIST_DECLARED) && defined(NSIG)
#if defined(HAVE_DECL_SYS_SIGLIST) && defined(NSIG)
return (signum >= 0 && signum < NSIG) ? sys_siglist[signum] : "?";
#else
return NULL;
@ -101,7 +101,7 @@ got_fatal_signal (int sig)
s = log_get_prefix (NULL);
if (s)
write(2, s, strlen (s));
write (2, ": ", 2 );
write (2, ": signal ", 9 );
s = get_signal_name(sig);
if (s)
write (2, s, strlen(s) );
@ -109,7 +109,6 @@ got_fatal_signal (int sig)
{
/* We are in a signal handler so we can't use any kind of printf
even not sprintf. USe a straightforward algorithm. */
write (2, "signal ", 7 );
if (sig < 0 || sig >= 100000)
write (2, "?", 1);
else