bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] tar: Record size = 8 blocks


From: Mads Kiilerich
Subject: Re: [Bug-tar] tar: Record size = 8 blocks
Date: Mon, 02 Mar 2009 18:47:27 +0100
User-agent: Thunderbird 2.0.0.18 (X11/20090107)

Ondřej Vašík wrote:
Ondřej Vašík wrote:
Obviously it is change in behaviour (in tar 1.20 verbose level > 1 was required to show that warning message). Attached patch should restore
silence again.

Sorry, I read 1.21 NEWS meanwhile and this change of behaviour is
expected and change written in NEWS file, so obviously it is correct
behaviour. Ignore patch ;), it seems that Mercury testsuite has to be
fixed.

For reference:
** Fixed record size autodetection.  If detected record size differs from
the expected value (either default, or set on the command line), tar
always prints a warning if verbosity level is set to 1 or greater,
i.e. if either -t or -v option is given.

But, if I understand the code and posix correctly:
* rmtread (when not _isrmt (fd) and through safe_read and safe_rw) calls read(2) with record_size as size_t * it is _always_ perfectly valid for read(2) to return less than the requested number of bytes - "especially" when reading from a pipe, both also when reading from a file or tape device * the purpose of short_read is to handle that situation and keep reading until a full record_size is read
* the new thing is that short_read (with -t option) will give a warning

I don't know exactly what "record size autodetection" is, but I don't see how it can be done before EOF has been reached. Doing it in the beginning of short_read does not seem right.

And it seems like there are other checks in place when EOF is reached, controlled by read_full_records ("Suppress fatal error on reading a partial record").

/Mads






reply via email to

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