Mercurial > hg > octave-lojdl > gnulib-hg
changeset 12333:d904c3a8f14c
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.
author | Jim Meyering <meyering@redhat.com> |
---|---|
date | Sat, 21 Nov 2009 17:52:54 +0100 |
parents | 87377cb9705f |
children | 911f28ebb9c4 |
files | ChangeLog lib/c-stack.c modules/c-stack |
diffstat | 3 files changed, 13 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -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'.
--- a/lib/c-stack.c +++ b/lib/c-stack.c @@ -72,6 +72,7 @@ #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 @@ 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);