mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
(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:
parent
d8718bd67f
commit
a5c4c4bf12
@ -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>
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user