]> Dogcows Code - chaz/tar/blobdiff - src/buffer.c
Report record size only if the archive refers to a device.
[chaz/tar] / src / buffer.c
index 8edc257fe63ba27510eae8a4153ee2b02c48bf0b..a01af374c3b4a00d77992d057e739f4274757c75 100644 (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,
This page took 0.020645 seconds and 4 git commands to generate.