Blob Blame History Raw
From: Ondrej Dubaj <odubaj@redhat.com>
Date: Tue, 13 Apr 2021 11:47:32 +0200
Subject: [PATCH] do not report read disk error as file shrank

diff --git a/src/create.c b/src/create.c
index 181f7d9..7be10a9 100644
--- a/src/create.c
+++ b/src/create.c
@@ -1097,7 +1097,7 @@ dump_regular_file (int fd, struct tar_stat_info *st)
       size_left -= count;
       set_next_block_after (blk + (bufsize - 1) / BLOCKSIZE);
 
-      if (count != bufsize)
+      if (count == 0)
 	{
 	  char buf[UINTMAX_STRSIZE_BOUND];
 	  memset (blk->buffer + count, 0, bufsize - count);
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2d7939d..89fbf9a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -230,7 +230,6 @@ TESTSUITE_AT = \
  spmvp10.at\
  time01.at\
  time02.at\
- truncate.at\
  update.at\
  update01.at\
  update02.at\
diff --git a/tests/Makefile.in b/tests/Makefile.in
index db14044..238b210 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1457,7 +1457,6 @@ TESTSUITE_AT = \
  spmvp10.at\
  time01.at\
  time02.at\
- truncate.at\
  update.at\
  update01.at\
  update02.at\
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 2a83757..52f73a6 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -424,7 +424,6 @@ m4_include([comprec.at])
 m4_include([shortfile.at])
 m4_include([shortupd.at])
 
-m4_include([truncate.at])
 m4_include([grow.at])
 m4_include([sigpipe.at])
 m4_include([comperr.at])