On 17/05/11 14:48, Eric Blake wrote: > 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()
I thought that might be too invasive, but it's a definitely possibility. > 5. fix the clients to quit diagnosing an error when close_stdout will > also diagnose it I thought of that, but then the specific errno would be lost. cheers, Pádraig.
