This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/6] Don't hang if something goes wrong reading from a tar archive


On Apr  8 15:43, Jon TURNEY wrote:
> Returning EIO (a small positive integer) as the result of archive_tar_file::read()
> on an error isn't a good idea, it's indistinguishable from successfully reading
> a small number of bytes.
> 
> This causes io_stream::copy() to spin forever if it's reading from an archive stream
> which terminates unexpectedly early, which can happen on an decompression error.
> 
> So, return -1 and set lasterr instead.  This matches the behaviour of POSIX
> read(), so shouldn't surprise anyone :-)
> 
> Make the same change for archive_tar_file::write(), archive_tar_file::tell()
> and archive_tar_file::peek() for consistency
> 
> 2011-04-08  Jon TURNEY  <...>
> 
> 	* archive_tar_file.cc (read, write, peek, seek): Consistently return -1
> 	and set lasterr on an error.

Please commit.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]