From 3dc34ed30d9e79a0f67a6734e709b36fea9f826f Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 24 Jun 2013 19:23:57 +0000 Subject: [PATCH] Do the same thing for pscp that I did for psh to avoid perl misbehavior on opening a reference to null glob git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16737 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/pscp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/xCAT-client/bin/pscp b/xCAT-client/bin/pscp index ee3e7c2c6..0b57a6935 100755 --- a/xCAT-client/bin/pscp +++ b/xCAT-client/bin/pscp @@ -105,12 +105,9 @@ if ($interface) { foreach (@nodes) { my $node=$_; while ($children > $pshmaxp) { processoutput($inputs); } - my $child; $children++; #scpnode(\$child,$node,@ARGV[0],$destloc); - scpnode(\$child,$node,\@scpargs,$destloc); - $inputs->add($child); - $nodehdl{$child} = $node; + scpnode($inputs,\%nodehdl,$node,\@scpargs,$destloc); } while ($inputs->count and $children) { processoutput($inputs); @@ -139,6 +136,8 @@ sub processoutput { #This way, one arbiter handles output, no interrupting return $rc; } sub scpnode { + my $inputs = shift; + my $nodehdl = shift; my $out = shift; my $node = shift; my $in; @@ -147,7 +146,10 @@ sub scpnode { my $scpargsr = shift; my @scpargs = @{$scpargsr}; my $dest = shift; - open($$out, "scp -o BatchMode=yes @scpargs $node:$dest 2>&1 |"); + my $child; + open($child, "scp -o BatchMode=yes @scpargs $node:$dest 2>&1 |"); + $inputs->add($child); + $nodehdl->{$child} = $node; } # vim: set et sw=2 ts=2 sts=2: