]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Gracefully degrade if Time::HiRes is not available
authorJacob Bachmeyer <jcb@gnu.org>
Wed, 8 Feb 2023 04:42:59 +0000 (22:42 -0600)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 29 Mar 2023 19:16:05 +0000 (12:16 -0700)
Copyright-paperwork-exempt: yes

lib/Automake/FileUtils.pm

index 697ff7e637820e6c713c7c6bbab332d72d73a4d3..8d0b36802f6672103a5a0fc4eb0a9afeefdbb323 100644 (file)
@@ -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;