bug-gzip
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#32342: [PATCH] Do not store mtime when compressing stdin


From: Bernhard M. Wiedemann
Subject: bug#32342: [PATCH] Do not store mtime when compressing stdin
Date: Wed, 1 Aug 2018 13:51:40 +0200

This allows for reproducible output of
echo foo | gzip | md5sum
tar -cz -H ustar SOMEFILE | md5sum

See https://reproducible-builds.org/ for why this is good.
---
 gzip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gzip.c b/gzip.c
index a023d81..4b00e42 100644
--- a/gzip.c
+++ b/gzip.c
@@ -767,7 +767,7 @@ local void treat_stdin()
       {
         if (S_ISREG (istat.st_mode))
           time_stamp = get_stat_mtime (&istat);
-        else
+        else if (decompress)
           gettime (&time_stamp);
       }
 
-- 
2.16.4






reply via email to

[Prev in Thread] Current Thread [Next in Thread]