aboutsummaryrefslogtreecommitdiffstats
path: root/common/signal.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2010-04-20 01:11:35 +0000
committerMarcus Brinkmann <[email protected]>2010-04-20 01:11:35 +0000
commit0e960d940a3b52406bb72af2750b6b6d29e39067 (patch)
treef1836dba3a919ea6bd59a94fa6397f461ef222be /common/signal.c
parentFixed dependencies and a syntax error (diff)
downloadgnupg-0e960d940a3b52406bb72af2750b6b6d29e39067.tar.gz
gnupg-0e960d940a3b52406bb72af2750b6b6d29e39067.zip
common/
2010-04-20 Marcus Brinkmann <[email protected]> * logging.c (do_log_ignore_arg): New helper function. (log_string): Use it to remove ugly volatile hack that causes gcc warning. (log_flush): Likewise. * sysutils.c (gnupg_unsetenv) [!HAVE_W32CE_SYSTEM]: Return something. (gnupg_setenv) [!HAVE_W32CE_SYSTEM]: Likewise. * pka.c (get_pka_info): Solve strict aliasing rule violation. * t-exechelp.c (test_close_all_fds): Use dummy variables to silence gcc warning. kbx/ 2010-04-20 Marcus Brinkmann <[email protected]> * keybox-update.c [!HAVE_DOSISH_SYSTEM]: Include ../common/sysutils.h even then to silence gcc warning about missing declaration of gnupg_remove. tools/ 2010-04-20 Marcus Brinkmann <[email protected]> * gpgconf-comp.c (option_check_validity): Use dummy variables to silence gcc warning.
Diffstat (limited to '')
-rw-r--r--common/signal.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/common/signal.c b/common/signal.c
index 422f6af3a..ee55f1917 100644
--- a/common/signal.c
+++ b/common/signal.c
@@ -89,6 +89,8 @@ get_signal_name( int signum )
static RETSIGTYPE
got_fatal_signal (int sig)
{
+ /* Dummy result variable to suppress gcc warning. */
+ int res;
const char *s;
if (caught_fatal_sig)
@@ -98,14 +100,14 @@ got_fatal_signal (int sig)
if (cleanup_fnc)
cleanup_fnc ();
/* Better don't translate these messages. */
- write (2, "\n", 1 );
+ res = write (2, "\n", 1 );
s = log_get_prefix (NULL);
if (s)
- write(2, s, strlen (s));
- write (2, ": signal ", 9 );
+ res = write(2, s, strlen (s));
+ res = write (2, ": signal ", 9 );
s = get_signal_name(sig);
if (s)
- write (2, s, strlen(s) );
+ res = write (2, s, strlen(s) );
else
{
/* We are in a signal handler so we can't use any kind of printf
@@ -115,7 +117,7 @@ got_fatal_signal (int sig)
things are messed up because we modify its value. Although
this is a bug in that system, we will protect against it. */
if (sig < 0 || sig >= 100000)
- write (2, "?", 1);
+ res = write (2, "?", 1);
else
{
int i, value, any=0;
@@ -124,7 +126,7 @@ got_fatal_signal (int sig)
{
if (value >= i || ((any || i==1) && !(value/i)))
{
- write (2, "0123456789"+(value/i), 1);
+ res = write (2, "0123456789"+(value/i), 1);
if ((value/i))
any = 1;
value %= i;
@@ -132,7 +134,7 @@ got_fatal_signal (int sig)
}
}
}
- write (2, " caught ... exiting\n", 20);
+ res = write (2, " caught ... exiting\n", 20);
/* Reset action to default action and raise signal again */
init_one_signal (sig, SIG_DFL, 0);