From df57f4270959d6679422896ca6f579d048777d81 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 21 Nov 2009 17:52:54 +0100 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ lib/c-stack.c | 9 +++++---- modules/c-stack | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d99d3875e..04b2a6b7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-11-21 Jim Meyering + + 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 diffseq: reduce scope of variable 'best'. diff --git a/lib/c-stack.c b/lib/c-stack.c index 1dddeefc4..044272cc3 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 22dd18c1a..83de3f8ba 100644 --- a/modules/c-stack +++ b/modules/c-stack @@ -10,6 +10,7 @@ Depends-on: gettext-h errno exitfail +ignore-value unistd raise sigaction -- 2.11.0