bug-tar
[Top][All Lists]
Advanced

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

Re: Tar doesn't handle short reads


From: Dominique Martinet
Subject: Re: Tar doesn't handle short reads
Date: Thu, 6 Aug 2020 07:07:52 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Paul Eggert wrote on Wed, Aug 05, 2020:
> On 8/5/20 2:58 PM, Dominique Martinet wrote:
> >if the second read fails with EIO then at that point in the loop ret < 0
> >and full_read returns -1.
> 
> Are you looking at the same source code I am? There is no "ret < 0"
> in lib/full-write.c - at least, not in my copy of GNU Tar (I'm
> looking at current git as built via "./bootstrap").

Appologies, I was indeed looking at another implementation, that's what
I get for blindly trusting cscope which can't follow the couple of
#defines to get there.

You are correct that the caller should be adapted if we want to use it
as is, the comment above the function definition suggests comparing
errno with 0 when the return value is less than the requested value to
check if that was EOF or an error.

I personally find the other implementation cscope had found in
gnulib/tests/test-nonblocking-reader.h easier to use but that makes
sense for write and probably doesn't deserve trying to split the
implementation at this point... :)


Sorry for the confusion, I'll let you two hash it out it seems to be in
good hands.
On the 9p side I'm still thinking this through, need to discuss this a
bit more.
-- 
Dominique | Asmadeus



reply via email to

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