[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] c-stack: avoid "ignoring return value of `write'" warning
From: |
Jim Meyering |
Subject: |
[PATCH] c-stack: avoid "ignoring return value of `write'" warning |
Date: |
Sat, 21 Nov 2009 17:55:39 +0100 |
It was easy and safe to ignore these four warnings, so...
>From df57f4270959d6679422896ca6f579d048777d81 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
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 d99d387..04b2a6b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-11-21 Jim Meyering <address@hidden>
+
+ 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 <address@hidden>
diffseq: reduce scope of variable 'best'.
diff --git a/lib/c-stack.c b/lib/c-stack.c
index 1dddeef..044272c 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 22dd18c..83de3f8 100644
--- a/modules/c-stack
+++ b/modules/c-stack
@@ -10,6 +10,7 @@ Depends-on:
gettext-h
errno
exitfail
+ignore-value
unistd
raise
sigaction
--
1.6.5.3.433.g11067
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] c-stack: avoid "ignoring return value of `write'" warning,
Jim Meyering <=