coreutils
[Top][All Lists]
Advanced

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

Re: [RFC] closeout redundant diagnostic


From: Eric Blake
Subject: Re: [RFC] closeout redundant diagnostic
Date: Tue, 17 May 2011 07:48:47 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 05/17/2011 05:11 AM, Pádraig Brady wrote:
> I was just testing a framebuffer device here and
> noticed that there were 2 errors printed by `tr`
> 
> $ tr '\0' $(($RANDOM % 256)) </dev/zero >/dev/full
> tr: write error: No space left on device
> tr: write error
> 
> I was then wondering it there was some other
> error with the device rather than just filling it.
> But the latter error is just closeout() noticing
> the original write error, and diagnosing just
> in case the original writer did not.
> 
> So 3 options.
> 
> 1. leave as is
> 2. assume all writers will diagnose,
> so don't diagnose previous errors in closeout()
> 3. make it configurable (with close_stdout_set_ignore_previous())

4. any client that diagnoses its own errors before calling closeout()
should also call clearerr()

5. fix the clients to quit diagnosing an error when close_stdout will
also diagnose it

That is, I think that tr.c could be simplified to quit checking fwrite
failures, and rely on close_stdout to do the check instead.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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