aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Iurt/Process.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-25 23:28:54 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-25 23:28:54 +0000
commit179937ac7b6d71fc52a01833b766402c3fc80bc4 (patch)
treecc0a9458030d861b33fcda8820433d3600470830 /lib/Iurt/Process.pm
parente39be2ec4cff20c70c4ead81e55231094f2bfe5e (diff)
downloadiurt-179937ac7b6d71fc52a01833b766402c3fc80bc4.tar
iurt-179937ac7b6d71fc52a01833b766402c3fc80bc4.tar.gz
iurt-179937ac7b6d71fc52a01833b766402c3fc80bc4.tar.bz2
iurt-179937ac7b6d71fc52a01833b766402c3fc80bc4.tar.xz
iurt-179937ac7b6d71fc52a01833b766402c3fc80bc4.zip
(perform_command) store perl error earlier in case it's modified between eval {} and if()
Diffstat (limited to 'lib/Iurt/Process.pm')
-rw-r--r--lib/Iurt/Process.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Iurt/Process.pm b/lib/Iurt/Process.pm
index 696ac91..957c388 100644
--- a/lib/Iurt/Process.pm
+++ b/lib/Iurt/Process.pm
@@ -198,6 +198,8 @@ sub perform_command {
};
$err = $?;
+ my $perl_err = $@;
+
# <mrl> Log it before any changes on it.
plog('DEBUG', "Command exited with $err.");
$err = 0 if any { $_ == $err } @{$opt{error_ok}};
@@ -205,9 +207,9 @@ sub perform_command {
# kill pid watching log file size
kill_for_good($pid) if $pid;
- if ($@) { # timed out
+ if ($perl_err) { # timed out
# propagate unexpected errors
- die "FATAL: unexpected signal ($@)" unless $@ eq "alarm\n";
+ die "FATAL: unexpected signal ($perl_err)" unless $perl_err eq "alarm\n";
}
# Keep the run first on the harddrive so that one can check the