From d381d3e7233f7c0d415fdbe6d678731b1a6ae809 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Mon, 9 Mar 2015 14:45:07 +0800 Subject: [PATCH] Fix bug#4570 - [FVT] xCAT::Utils->runcmd() did not set a correct $::RUNCMD_RC when streaming mode is using --- perl-xCAT/xCAT/Utils.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 549ab8618..b920ef108 100755 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -1013,10 +1013,11 @@ sub runcmd } # store the return string #push @$outref,$output; + close(PIPE); # This will set the $? properly } # now if not streaming process errors - if (($?) && (!defined($stream))) + if ($?) { $::RUNCMD_RC = $? >> 8; my $displayerror = 1;