diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2023-01-21 01:15:19 -0600 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2023-01-21 01:18:08 -0600 |
commit | 9d2637467df1d4811449dd14b2bebc142d9092b6 (patch) | |
tree | 3f6b1f5b9a4fdd21c6d554f09eab2f7e3e0e4df5 | |
parent | b751bf49496ea3f0054533cfd63f977640abb07a (diff) | |
download | autoconf-9d2637467df1d4811449dd14b2bebc142d9092b6.tar.gz |
Restore lib/Autom4te/FileUtils.pm local fixes
These were lost by 'make fetch'.
-rw-r--r-- | lib/Autom4te/FileUtils.pm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/Autom4te/FileUtils.pm b/lib/Autom4te/FileUtils.pm index 5d0deff9..8f7e351a 100644 --- a/lib/Autom4te/FileUtils.pm +++ b/lib/Autom4te/FileUtils.pm @@ -39,7 +39,7 @@ 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,16 @@ 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; + # Unfortunately Time::HiRes converts timestamps to floating-point, and the + # rounding error can be several nanoseconds for circa-2021 timestamps. + # Perhaps some day Perl will support accurate file timestamps. For now, do + # the best we can without going outside Perl. + + return $mtime; } |