diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/c-stack.c | 9 | ||||
-rw-r--r-- | modules/c-stack | 1 |
3 files changed, 13 insertions, 4 deletions
@@ -1,3 +1,10 @@ +2009-11-21 Jim Meyering <meyering@redhat.com> + + c-stack: avoid "ignoring return value of `write'" warning + * lib/c-stack.c: Include "ignore-value.h". + (die): Explicitly ignore each write return value. + * modules/c-stack (Depends-on): Add ignore-value. + 2009-11-21 Bruno Haible <bruno@clisp.org> diffseq: reduce scope of variable 'best'. diff --git a/lib/c-stack.c b/lib/c-stack.c index 1dddeefc41..044272cc3e 100644 --- a/lib/c-stack.c +++ b/lib/c-stack.c @@ -72,6 +72,7 @@ typedef struct sigaltstack stack_t; #include "c-stack.h" #include "exitfail.h" +#include "ignore-value.h" #if defined SA_ONSTACK && defined SA_SIGINFO # define SIGACTION_WORKS 1 @@ -105,10 +106,10 @@ die (int signo) char const *message; segv_action (signo); message = signo ? program_error_message : stack_overflow_message; - write (STDERR_FILENO, program_name, strlen (program_name)); - write (STDERR_FILENO, ": ", 2); - write (STDERR_FILENO, message, strlen (message)); - write (STDERR_FILENO, "\n", 1); + ignore_value (write (STDERR_FILENO, program_name, strlen (program_name))); + ignore_value (write (STDERR_FILENO, ": ", 2)); + ignore_value (write (STDERR_FILENO, message, strlen (message))); + ignore_value (write (STDERR_FILENO, "\n", 1)); if (! signo) _exit (exit_failure); raise (signo); diff --git a/modules/c-stack b/modules/c-stack index 22dd18c1af..83de3f8bad 100644 --- a/modules/c-stack +++ b/modules/c-stack @@ -10,6 +10,7 @@ Depends-on: gettext-h errno exitfail +ignore-value unistd raise sigaction |