automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[automake-commit] 02/04: Gracefully degrade if Time::HiRes is not availa


From: Paul Eggert
Subject: [automake-commit] 02/04: Gracefully degrade if Time::HiRes is not available
Date: Wed, 29 Mar 2023 15:16:40 -0400

eggert pushed a commit to branch master
in repository automake.

View the commit online:
https://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=efce8539b2d3c1211ef18ac8f020b2ae36e255ab

commit efce8539b2d3c1211ef18ac8f020b2ae36e255ab
Author: Jacob Bachmeyer <jcb@gnu.org>
AuthorDate: Tue Feb 7 22:42:59 2023 -0600

    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;
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]