Blame SOURCES/tar-1.30-disk-read-error.patch

e176b8
From: Ondrej Dubaj <odubaj@redhat.com>
e176b8
Date: Tue, 13 Apr 2021 11:47:32 +0200
e176b8
Subject: [PATCH] do not report read disk error as file shrank
e176b8
e176b8
diff --git a/src/create.c b/src/create.c
e176b8
index 181f7d9..7be10a9 100644
e176b8
--- a/src/create.c
e176b8
+++ b/src/create.c
e176b8
@@ -1097,7 +1097,7 @@ dump_regular_file (int fd, struct tar_stat_info *st)
e176b8
       size_left -= count;
e176b8
       set_next_block_after (blk + (bufsize - 1) / BLOCKSIZE);
e176b8
 
e176b8
-      if (count != bufsize)
e176b8
+      if (count == 0)
e176b8
 	{
e176b8
 	  char buf[UINTMAX_STRSIZE_BOUND];
e176b8
 	  memset (blk->buffer + count, 0, bufsize - count);
e176b8
diff -rup tar-1.34/tests/Makefile.am.old tar-1.34/tests/Makefile.am
e176b8
--- tar-1.34/tests/Makefile.am.old	2022-06-27 09:21:40.881574517 +0000
e176b8
+++ tar-1.34/tests/Makefile.am	2022-06-27 09:23:31.444574517 +0000
e176b8
@@ -247,7 +247,6 @@ TESTSUITE_AT = \
e176b8
  sptrdiff01.at\
e176b8
  time01.at\
e176b8
  time02.at\
e176b8
- truncate.at\
e176b8
  update.at\
e176b8
  update01.at\
e176b8
  update02.at\
e176b8
diff -rup tar-1.34/tests/Makefile.in.old tar-1.34/tests/Makefile.in
e176b8
--- tar-1.34/tests/Makefile.in.old	2022-06-27 09:21:48.626574517 +0000
e176b8
+++ tar-1.34/tests/Makefile.in	2022-06-27 09:22:03.127574517 +0000
e176b8
@@ -1622,7 +1622,6 @@ TESTSUITE_AT = \
e176b8
  sptrdiff01.at\
e176b8
  time01.at\
e176b8
  time02.at\
e176b8
- truncate.at\
e176b8
  update.at\
e176b8
  update01.at\
e176b8
  update02.at\
e176b8
diff --git a/tests/testsuite.at b/tests/testsuite.at
e176b8
index 2a83757..52f73a6 100644
e176b8
--- a/tests/testsuite.at
e176b8
+++ b/tests/testsuite.at
e176b8
@@ -424,7 +424,6 @@ m4_include([comprec.at])
e176b8
 m4_include([shortfile.at])
e176b8
 m4_include([shortupd.at])
e176b8
 
e176b8
-m4_include([truncate.at])
e176b8
 m4_include([grow.at])
e176b8
 m4_include([sigpipe.at])
e176b8
 m4_include([comperr.at])