c-stack: avoid "ignoring return value of `write'" warning
authorJim Meyering <meyering@redhat.com>
Sat, 21 Nov 2009 16:52:54 +0000 (17:52 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 21 Nov 2009 16:54:27 +0000 (17:54 +0100)
* lib/c-stack.c: Include "ignore-value.h".
(die): Explicitly ignore each write return value.
* modules/c-stack (Depends-on): Add ignore-value.

ChangeLog
lib/c-stack.c
modules/c-stack

index d99d387..04b2a6b 100644 (file)
--- 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'.
index 1dddeef..044272c 100644 (file)
@@ -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);
index 22dd18c..83de3f8 100644 (file)
@@ -10,6 +10,7 @@ Depends-on:
 gettext-h
 errno
 exitfail
+ignore-value
 unistd
 raise
 sigaction