Blame SOURCES/diffutils-cmp-s-empty.patch

6fb0ed
diff -up diffutils-3.6/src/cmp.c.cmp-s-empty diffutils-3.6/src/cmp.c
6fb0ed
--- diffutils-3.6/src/cmp.c.cmp-s-empty	2017-05-18 18:39:59.000000000 +0100
6fb0ed
+++ diffutils-3.6/src/cmp.c	2017-05-22 10:53:28.477147864 +0100
6fb0ed
@@ -330,12 +330,15 @@ main (int argc, char **argv)
6fb0ed
 
6fb0ed
   /* If only a return code is needed,
6fb0ed
      and if both input descriptors are associated with plain files,
6fb0ed
+     and if both files are larger than 0 bytes (procfs files are always 0),
6fb0ed
      conclude that the files differ if they have different sizes
6fb0ed
      and if more bytes will be compared than are in the smaller file.  */
6fb0ed
 
6fb0ed
   if (comparison_type == type_status
6fb0ed
       && S_ISREG (stat_buf[0].st_mode)
6fb0ed
-      && S_ISREG (stat_buf[1].st_mode))
6fb0ed
+      && S_ISREG (stat_buf[1].st_mode)
6fb0ed
+      && stat_buf[0].st_size > 0
6fb0ed
+      && stat_buf[1].st_size > 0)
6fb0ed
     {
6fb0ed
       off_t s0 = stat_buf[0].st_size - file_position (0);
6fb0ed
       off_t s1 = stat_buf[1].st_size - file_position (1);