coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] head,tail: consistently diagnose write errors


From: Bernhard Voelker
Subject: Re: [PATCH] head,tail: consistently diagnose write errors
Date: Thu, 30 Jan 2014 00:02:08 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 01/29/2014 07:43 PM, Pádraig Brady wrote:
> On 01/29/2014 12:06 PM, Pádraig Brady wrote:
> 
>> --- a/NEWS
>> +++ b/NEWS
> 
>> +  tail now diagnoses all failures when writing to stdout.  Previously write
>> +  errors could have been silently ignored if some data was output.
>> +  [This bug was present in "the beginning".]
> 
> Actually this is not the case. The atexit handler would have caught
> partial write failures, albeit with a less detailed error message.
> So I'll remove the NEWS but leave the code changes.

Thanks.

It seems your patch didn't make it thru the mail systems:

  error: patch failed: src/head.c:504
  error: src/head.c: patch does not apply
  Patch failed at 0001 head,tail: consistently diagnose write errors

Can you resend as attachment, please?

However, if head is exiting earlier on the first write error,
then there should be a user visible change.

  $ seq -f'%1000g' 1000 | { src/head --lines=-1 > /dev/full ; wc -l ; }
  src/head: write error
  0

With the patch, I'd expect wc to see more than 0 lines in the above
case, right?

> +if ! test -w /dev/full || ! test -c /dev/full; then
> +  skip_ '/dev/full is required'
> +fi

There are already a few tests using /dev/full, so the above check
seems to be worth factoring out into something like

  dev_full_works_ || skip_ 'A working /dev/full is required'

Have a nice day,
Berny




reply via email to

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