[Top][All Lists]

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

[PATCH] up_to_date_p: treat equal mtime as outdated.

From: Harald van Dijk
Subject: [PATCH] up_to_date_p: treat equal mtime as outdated.
Date: Sat, 11 Apr 2020 20:28:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:75.0) Gecko/20100101 Thunderbird/75.0

The up_to_date_p function uses mtime, which returns timestamps with
second precision. Even if it were capable of returning higher precision
timestamps, the file system might not support it.

With second precision timestamps, when two timestamps are equal, we do
not know which is newer and need to account for the worst case scenario.

This caused intermittent failures in automake's t/subobj.sh test, which
runs aclocal+automake, modifies configure.ac, and immediately re-runs
aclocal+automake. On sufficiently fast computers, this would not update
the cache files.
 lib/Autom4te/FileUtils.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Autom4te/FileUtils.pm b/lib/Autom4te/FileUtils.pm
index 16b2de97..6f82f8c0 100644
--- a/lib/Autom4te/FileUtils.pm
+++ b/lib/Autom4te/FileUtils.pm
@@ -194,7 +194,7 @@ sub up_to_date_p ($@)
    foreach my $dep (@dep)
-      if ($mtime < mtime ($dep))
+      if ($mtime <= mtime ($dep))
          verb "up_to_date ($file): outdated: $dep";
          return 0;

reply via email to

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