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
This commit is contained in:
jbjohnso 2013-06-24 19:23:57 +00:00
parent 6c6f16a8f5
commit 3dc34ed30d

View File

@ -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: