* gzip.c: Include "timespec.h".
(treat_stdin): Use st_mtime only from a regular file.
This matters at least on Cygwin 1.7.1-1, for which a stdin-pipe has
the mtime of /dev/null, rather than the gzip-documented-for-pipes
"current time". Reported by Denis Excoffier.
Enami enami@sys.ptg.sony.co.jp
Kristoffer Eriksson ske@pkmab.se
Daniel Eriksson m91der@bellatrix.tdb.uu.se
+Denis Excoffier 3.1416@free.fr
Rik Faith faith@cs.unc.edu
Larry Fahnoe fahnoe@c1mpls.mn.org
Cristian Ferretti cfs@poincare.mat.puc.cl
#include "gzip.h"
#include "lzw.h"
#include "revision.h"
+#include "timespec.h"
#include "fcntl-safer.h"
#include "getopt.h"
ifile_size = S_ISREG (istat.st_mode) ? istat.st_size : -1;
time_stamp.tv_nsec = -1;
if (!no_time || list)
- time_stamp = get_stat_mtime (&istat);
+ {
+ if (S_ISREG (istat.st_mode))
+ time_stamp = get_stat_mtime (&istat);
+ else
+ gettime (&time_stamp);
+ }
clear_bufs(); /* clear input and output buffers */
to_stdout = 1;