mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02: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
|
* signal.c (got_fatal_signal): Print the signal number if we can't
|
||||||
get a name for it.
|
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>
|
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
|
/* Note that we can't use strsignal(), because it is not
|
||||||
reentrant. */
|
reentrant. */
|
||||||
#if defined(SYS_SIGLIST_DECLARED) && defined(NSIG)
|
#if defined(HAVE_DECL_SYS_SIGLIST) && defined(NSIG)
|
||||||
return (signum >= 0 && signum < NSIG) ? sys_siglist[signum] : "?";
|
return (signum >= 0 && signum < NSIG) ? sys_siglist[signum] : "?";
|
||||||
#else
|
#else
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -101,7 +101,7 @@ got_fatal_signal (int sig)
|
|||||||
s = log_get_prefix (NULL);
|
s = log_get_prefix (NULL);
|
||||||
if (s)
|
if (s)
|
||||||
write(2, s, strlen (s));
|
write(2, s, strlen (s));
|
||||||
write (2, ": ", 2 );
|
write (2, ": signal ", 9 );
|
||||||
s = get_signal_name(sig);
|
s = get_signal_name(sig);
|
||||||
if (s)
|
if (s)
|
||||||
write (2, s, strlen(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
|
/* We are in a signal handler so we can't use any kind of printf
|
||||||
even not sprintf. USe a straightforward algorithm. */
|
even not sprintf. USe a straightforward algorithm. */
|
||||||
write (2, "signal ", 7 );
|
|
||||||
if (sig < 0 || sig >= 100000)
|
if (sig < 0 || sig >= 100000)
|
||||||
write (2, "?", 1);
|
write (2, "?", 1);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user