From 53617163491841eb896f413c28b1c39dae5c49be Mon Sep 17 00:00:00 2001 From: jjhua Date: Fri, 14 Dec 2012 09:35:18 +0000 Subject: [PATCH] fixed bug 3248 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14657 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/DSHCore.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/perl-xCAT/xCAT/DSHCore.pm b/perl-xCAT/xCAT/DSHCore.pm index 5cd4df743..e9afee21a 100644 --- a/perl-xCAT/xCAT/DSHCore.pm +++ b/perl-xCAT/xCAT/DSHCore.pm @@ -227,13 +227,14 @@ no strict; $| = 1; select(STDERR); $| = 1; - - my $command0 = $commands[0]; - my @exe_command0_process = xCAT::DSHCore->fork_no_output($fork_id, @$command0); - waitpid($exe_command0_process[0], undef); - - my $t_command = $commands[1]; - my @command = @$t_command; + if ( @commands > 1 ) { + my $command0 = shift(@commands); + my @exe_command0_process = xCAT::DSHCore->fork_no_output($fork_id, @$command0); + waitpid($exe_command0_process[0], undef); + } + + my $t_command = shift(@commands); + my @command = @$t_command; if (!(exec {$command[0]} @command)) { return (-4, undef);