[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] fprintftime: avoid a warning about ignored fwrite return val
From: |
James Youngman |
Subject: |
Re: [PATCH] fprintftime: avoid a warning about ignored fwrite return value |
Date: |
Mon, 9 Nov 2009 10:22:49 +0000 |
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.
> ---
> ChangeLog | 6 ++++++
> lib/strftime.c | 11 ++++++++++-
> modules/fprintftime | 1 +
> 3 files changed, 17 insertions(+), 1 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index 54a79e8..ed3e6bd 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,5 +1,11 @@
> 2009-10-28 Jim Meyering <address@hidden>
>
> + 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.
> +
> exclude: avoid an unwarranted warning
> * lib/exclude.c (excluded_file_name): Initialize "rc" before switch.
>
> diff --git a/lib/strftime.c b/lib/strftime.c
> index fff5d38..7f06d6f 100644
> --- a/lib/strftime.c
> +++ b/lib/strftime.c
> @@ -31,6 +31,7 @@
> # else
> # include "strftime.h"
> # endif
> +# include "ignore-value.h"
> #endif
(This comment duplicates a separate thread)
I think the inclusion of "ignore-value.h" should be inside the first #if.
James.
- Re: [PATCH] fprintftime: avoid a warning about ignored fwrite return value,
James Youngman <=