summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas K. Hüttel <dilfridge@gentoo.org>2021-08-31 17:01:47 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2021-08-31 17:35:42 -0700
commit3a9802d60156809c139e9b4620bf04917e143ee2 (patch)
treebb499d851fda160b95714071ec01a2bfb9ca6653
parentb27bc3e230bb12fdd9a813e38e82bc4c3e22b4cc (diff)
downloadautoconf-3a9802d60156809c139e9b4620bf04917e143ee2.tar.gz
Fix bug when autom4te updates too quickly
Use stat from Time::HiRes (instead of File::stat). Problem reported by Ionen Wolkens <https://bugs.gentoo.org/782985>.
-rw-r--r--lib/Autom4te/FileUtils.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Autom4te/FileUtils.pm b/lib/Autom4te/FileUtils.pm
index a182031b..27a5fd91 100644
--- a/lib/Autom4te/FileUtils.pm
+++ b/lib/Autom4te/FileUtils.pm
@@ -34,12 +34,12 @@ This perl module provides various general purpose file handling functions.
=cut
-use 5.006;
+use 5.008;
use strict;
use warnings FATAL => 'all';
use Exporter;
-use File::stat;
+use Time::HiRes qw(stat);
use IO::File;
use Autom4te::Channels;
@@ -115,10 +115,11 @@ sub mtime ($)
return 0
if $file eq '-' || ! -f $file;
- my $stat = stat ($file)
+ my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+ $atime,$mtime,$ctime,$blksize,$blocks) = stat ($file)
or fatal "cannot stat $file: $!";
- return $stat->mtime;
+ return $mtime;
}