summaryrefslogtreecommitdiff
path: root/lib/utimecmp.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2010-12-01 21:25:56 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2010-12-01 21:26:17 -0800
commit17dec92a4e9b41a92d6ecd15b73b2ba8a4b50402 (patch)
tree6092f695de95720f5797732a096d33d732cf0a30 /lib/utimecmp.c
parent93d8411fd568e326073eb508fa727dc53cee8b7d (diff)
downloadgnulib-17dec92a4e9b41a92d6ecd15b73b2ba8a4b50402.tar.gz
utimecmp: fine-grained src to nearby coarse-grained dest
* lib/utimecmp.c (utimecmp): When UTIMECMP_TRUNCATE_SOURCE is set, and the source is on a file system with higher-resolution time stamps, than the destination, and _PC_TIMESTAMP_RESOLUTION does not work, and the time stamps are close together, the algorithm to determine the exact resolution from the read-back mtime was buggy: it had a "!=" where it should have had an "==". This bug has been in the code ever since it was introduced to gnulib. Problem reported by Dan Jacobson in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7529>.
Diffstat (limited to 'lib/utimecmp.c')
-rw-r--r--lib/utimecmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utimecmp.c b/lib/utimecmp.c
index 63a0c9a822..8c3ca65d95 100644
--- a/lib/utimecmp.c
+++ b/lib/utimecmp.c
@@ -325,7 +325,7 @@ utimecmp (char const *dst_name,
res = SYSCALL_RESOLUTION;
- for (a /= res; a % 10 != 0; a /= 10)
+ for (a /= res; a % 10 == 0; a /= 10)
{
if (res == BILLION)
{