aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2005-05-13 12:43:07 +0000
committerWerner Koch <[email protected]>2005-05-13 12:43:07 +0000
commita5c4c4bf129a78d1de0990daffb9b8d171824262 (patch)
tree0d1efe2cce415c8be8ee3e91e9d28228cb623bfe
parent(got_fatal_signal): Print the signal number if we can't (diff)
downloadgnupg-a5c4c4bf129a78d1de0990daffb9b8d171824262.tar.gz
gnupg-a5c4c4bf129a78d1de0990daffb9b8d171824262.zip
(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.
-rw-r--r--common/ChangeLog3
-rw-r--r--common/signal.c5
2 files changed, 4 insertions, 4 deletions
diff --git a/common/ChangeLog b/common/ChangeLog
index 0651f9ead..cf294fbd1 100644
--- a/common/ChangeLog
+++ b/common/ChangeLog
@@ -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 <[email protected]>
diff --git a/common/signal.c b/common/signal.c
index 97e2c39fe..f0d3df75e 100644
--- a/common/signal.c
+++ b/common/signal.c
@@ -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