From f726df43c9b7efe239e545a4a2aa3df0c6f86f86 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 3 Apr 2012 18:55:02 +0000 Subject: add infrastructure so that programs can alter the default timeout (10m) (needed for next commit, mga#4772) --- perl-install/run_program.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'perl-install') diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm index 65e3a0f56..7c0ba92c7 100644 --- a/perl-install/run_program.pm +++ b/perl-install/run_program.pm @@ -10,6 +10,13 @@ use log; 1; +my $default_timeout = 10 * 60; + +sub set_default_timeout { + my ($seconds) = @_; + $default_timeout = $seconds; +} + sub run_or_die { my ($name, @args) = @_; run($name, @args) or die "$name failed\n"; @@ -87,7 +94,7 @@ sub raw { $pid; } else { my $ok; - add2hash_($options, { timeout => 10 * 60 }); + add2hash_($options, { timeout => $default_timeout }); eval { local $SIG{ALRM} = sub { die "ALARM" }; my $remaining = $options->{timeout} && $options->{timeout} ne 'never' && alarm($options->{timeout}); -- cgit v1.2.1