stat: do not provide variable precision time stamps
authorJim Meyering <meyering@redhat.com>
Sat, 13 Nov 2010 07:02:02 +0000 (08:02 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 13 Nov 2010 10:40:52 +0000 (11:40 +0100)
* src/stat.c: Don't include fstimeprec.c.
(out_epoch_sec): Don't call fstimeprec.
* NEWS: Update description.
* doc/coreutils.texi: Likewise.

NEWS
doc/coreutils.texi
gnulib
src/stat.c

diff --git a/NEWS b/NEWS
index e77768d..51e0650 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -24,8 +24,9 @@ GNU coreutils NEWS                                    -*- outline -*-
   stat's %X, %Y, and %Z directives once again print only the integer
   part of seconds since the epoch.  This reverts a change from
   coreutils-8.6, that was deemed unnecessarily disruptive.  To obtain
-  a full resolution time stamp for %X, use %.X; if you want (say) just
-  3 fractional digits, use %.3X.  Likewise for %Y and %Z.
+  a nanosecond-precision floating point time stamp for %X use %.X;
+  if you want (say) just 3 fractional digits, use %.3X.  Likewise
+  for %Y and %Z.
 
   stat's new %W format directive would print floating point seconds.
   However, with the above change to %X, %Y and %Z, we've made %W work
index ce56b0e..6a4257f 100644 (file)
@@ -10718,10 +10718,10 @@ The valid @var{format} directives for files with @option{--format} and
 
 The @samp{%W}, @samp{%X}, @samp{%Y}, and @samp{%Z} formats accept a
 precision preceded by a period to specify the number of digits to
-print after the decimal point. For example, @samp{%.9X} outputs the
-last access time to nanosecond precision.  If a period is given but no
-precision, @command{stat} uses the estimated precision of the file
-system. When discarding excess precision, time stamps are truncated
+print after the decimal point.  For example, @samp{%.3X} outputs the
+last access time to millisecond precision.  If a period is given but no
+precision, @command{stat} uses 9 digits, so @samp{%.X} is equivalent to
+@samp{%.9X}  When discarding excess precision, time stamps are truncated
 toward minus infinity.
 
 @example
@@ -10737,7 +10737,7 @@ precision:
   $ stat -c '[%.3Y]' /usr
   [1288929712.114]
   $ stat -c '[%.Y]' /usr
-  [1288929712.114951]
+  [1288929712.114951834]
 @end example
 
 The mount point printed by @samp{%m} is similar to that output
diff --git a/gnulib b/gnulib
index 4baf5c1..6383a3b 160000 (submodule)
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 4baf5c1e594a65a315fbd5094eaeeb11f4630d18
+Subproject commit 6383a3bbe16d3615791568c030fed5bfe86a4381
index ae7ce02..b419f19 100644 (file)
@@ -63,7 +63,6 @@
 #include "file-type.h"
 #include "filemode.h"
 #include "fs.h"
-#include "fstimeprec.h"
 #include "getopt.h"
 #include "mountlist.h"
 #include "quote.h"
@@ -557,10 +556,7 @@ out_epoch_sec (char *pformat, size_t prefix_len, struct stat const *statbuf,
         }
       else
         {
-          static struct fstimeprec *tab;
-          if (! tab)
-            tab = fstimeprec_alloc ();
-          precision = fstimeprec (tab, statbuf);
+          precision = 9;
         }
 
       if (precision && ISDIGIT (dot[-1]))