Report record size only if the archive refers to a device.

* Makefile.am (INCLUDES): Add ../lib, for rmt-command.h
* src/buffer.c (short_read): Report the actual record size
only if the archive descriptor refers to a device.
* tests/pipe.at, tests/shortrec.at,
tests/sparsemvp.at: Reflect the above change.
* NEWS, configure.ac: Version 1.22.90
This commit is contained in:
Sergey Poznyakoff
2009-05-25 10:18:36 +03:00
parent 8f390db92f
commit be34933b63
8 changed files with 42 additions and 29 deletions

View File

@@ -41,7 +41,7 @@ tar_SOURCES = \
update.c\
utf8.c
INCLUDES = -I$(top_srcdir)/gnu -I../ -I../gnu -I$(top_srcdir)/lib
INCLUDES = -I$(top_srcdir)/gnu -I../ -I../gnu -I$(top_srcdir)/lib -I../lib
LDADD = ../lib/libtar.a ../gnu/libgnu.a $(LIBINTL) $(LIBICONV)

View File

@@ -679,6 +679,19 @@ archive_read_error (void)
return;
}
static bool
archive_is_dev ()
{
struct stat st;
if (fstat (archive, &st))
{
stat_diag (*archive_name_cursor);
return false;
}
return S_ISBLK (st.st_mode) || S_ISCHR (st.st_mode);
}
static void
short_read (size_t status)
{
@@ -690,7 +703,8 @@ short_read (size_t status)
if (left && left % BLOCKSIZE == 0
&& verbose_option
&& record_start_block == 0 && status != 0)
&& record_start_block == 0 && status != 0
&& archive_is_dev ())
{
unsigned long rsize = status / BLOCKSIZE;
WARN ((0, 0,