summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Bachmeyer <jcb@gnu.org>2023-02-07 22:42:59 -0600
committerPaul Eggert <eggert@cs.ucla.edu>2023-03-29 12:16:05 -0700
commitefce8539b2d3c1211ef18ac8f020b2ae36e255ab (patch)
tree324ad9585e57bde7d09cff17032c510ec954cab3
parent0e127700bdc1c96590d01d55ecd48b0864292c4f (diff)
downloadautomake-efce8539b2d3c1211ef18ac8f020b2ae36e255ab.tar.gz
Gracefully degrade if Time::HiRes is not available
Copyright-paperwork-exempt: yes
-rw-r--r--lib/Automake/FileUtils.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Automake/FileUtils.pm b/lib/Automake/FileUtils.pm
index 697ff7e63..8d0b36802 100644
--- a/lib/Automake/FileUtils.pm
+++ b/lib/Automake/FileUtils.pm
@@ -39,9 +39,12 @@ use strict;
use warnings FATAL => 'all';
use Exporter;
-use Time::HiRes qw(stat);
use IO::File;
+# use sub-second resolution timestamps if available,
+# carry on with one-second resolution timestamps if that is all we have
+BEGIN { eval { require Time::HiRes; import Time::HiRes qw(stat) } }
+
use Automake::Channels;
use Automake::ChannelDefs;