Blame SOURCES/tar-1.27-sparse-stat-detection.patch

b77676
diff --git a/lib/system.h b/lib/system.h
b77676
index ef46267..e7f531c 100644
b77676
--- a/lib/system.h
b77676
+++ b/lib/system.h
b77676
@@ -389,9 +389,16 @@ extern int errno;
b77676
 # define ST_NBLOCKSIZE 512
b77676
 #endif
b77676
 
b77676
+/* Network Appliance file systems store small files directly in the
b77676
+   inode if st_size <= 64; in this case the number of blocks can be
b77676
+   zero.  Perhaps other file systems have similar problems; so,
b77676
+   somewhat arbitrarily, do not consider a file to be sparse if
b77676
+   it has no blocks but st_size < ST_NBLOCKSIZE.  */
b77676
 #define ST_IS_SPARSE(st)                                  \
b77676
   (ST_NBLOCKS (st)                                        \
b77676
-    < ((st).st_size / ST_NBLOCKSIZE + ((st).st_size % ST_NBLOCKSIZE != 0)))
b77676
+   < ((st).st_size / ST_NBLOCKSIZE			  \
b77676
+      + ((st).st_size % ST_NBLOCKSIZE != 0		  \
b77676
+	 && (st).st_size / ST_NBLOCKSIZE != 0)))
b77676
 
b77676
 /* Declare standard functions.  */
b77676