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;