bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fprintftime: avoid a warning about ignored fwrite return val


From: Jim Meyering
Subject: Re: [PATCH] fprintftime: avoid a warning about ignored fwrite return value
Date: Mon, 09 Nov 2009 11:42:39 +0100

James Youngman wrote:

> On Wed, Oct 28, 2009 at 9:34 AM, Jim Meyering <address@hidden> wrote:
>> Here's hoping that POSIX (or ISO C) will eventually fix fputc/fwrite/etc.
>> so that we don't have to add caveats like what I wrote in the comment below.
>>
>> As far as I know, date, du --time and uptime are the only clients that
>> use fprintftime, so even if this can hide a real failure, it's not
>> *that* big a deal.
>>
>> From 119ae5514681e42839f83a4993021a222ec45daa Mon Sep 17 00:00:00 2001
>> From: Jim Meyering <address@hidden>
>> Date: Wed, 28 Oct 2009 10:24:09 +0100
>> Subject: [PATCH] fprintftime: avoid a warning about ignored fwrite return 
>> value
>>
>> * lib/strftime.c [FPRINTFTIME]: Include "ignore-value.h".
>> (cpy) [FPRINTFTIME]: Ignore fwrite failure, even though technically,
>> that is unsafe.
>> * modules/fprintftime (Depends-on): Add ignore-value.
>> ---
...
> I think the inclusion of "ignore-value.h" should be inside the first #if.

Good catch.  Thank you.
I've just fixed it with this:

>From 6553be82a4a522e50ece1a430e82a9b1dfd0f471 Mon Sep 17 00:00:00 2001
From: James Youngman <address@hidden>
Date: Mon, 9 Nov 2009 11:41:29 +0100
Subject: [PATCH] strftime.c: include ignore-value.h only when FPRINTFTIME is 
defined

* lib/strftime.c: Correct placement of #include "ignore-value.h".
---
 ChangeLog      |    5 +++++
 lib/strftime.c |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4c29111..27e3858 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-09  James Youngman  <address@hidden>
+
+       strftime.c: include ignore-value.h only when FPRINTFTIME is defined
+       * lib/strftime.c: Correct placement of #include "ignore-value.h".
+
 2009-11-08  Jim Meyering  <address@hidden>

        utimens: remove invalid futimesat call
diff --git a/lib/strftime.c b/lib/strftime.c
index 7d64c15..4ca2ffa 100644
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -27,11 +27,11 @@
 #else
 # include <config.h>
 # if FPRINTFTIME
+#  include "ignore-value.h"
 #  include "fprintftime.h"
 # else
 #  include "strftime.h"
 # endif
-# include "ignore-value.h"
 #endif

 #include <ctype.h>
--
1.6.5.2.351.g0943




reply via email to

[Prev in Thread] Current Thread [Next in Thread]