From efce8539b2d3c1211ef18ac8f020b2ae36e255ab Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Tue, 7 Feb 2023 22:42:59 -0600 Subject: Gracefully degrade if Time::HiRes is not available Copyright-paperwork-exempt: yes --- lib/Automake/FileUtils.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- cgit v1.2.1