From: Jacob Bachmeyer Date: Wed, 8 Feb 2023 04:42:59 +0000 (-0600) Subject: Gracefully degrade if Time::HiRes is not available X-Git-Tag: v1.16i~61 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=efce8539b2d3c1211ef18ac8f020b2ae36e255ab;p=thirdparty%2Fautomake.git Gracefully degrade if Time::HiRes is not available Copyright-paperwork-exempt: yes --- 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;