-Fix the same problem psh had for pscp and prsync
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1265 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
ebccf9c788
commit
8b9be733ef
@ -14,6 +14,7 @@ use Data::Dumper;
|
||||
use IO::Handle;
|
||||
use IO::Select;
|
||||
use xCAT::Utils;
|
||||
use Threads qw(yield);
|
||||
use Getopt::Long;
|
||||
use POSIX qw(:signal_h :errno_h :sys_wait_h);
|
||||
my $interface;
|
||||
@ -96,10 +97,11 @@ foreach (@nodes) {
|
||||
$inputs->add($child);
|
||||
$nodehdl{$child} = $node;
|
||||
}
|
||||
while ($children) {
|
||||
while ($inputs->count and $children) {
|
||||
processoutput($inputs);
|
||||
}
|
||||
while (processoutput($inputs)) {};
|
||||
wait;
|
||||
exit(0);
|
||||
|
||||
sub processoutput { #This way, one arbiter handles output, no interrupting
|
||||
@ -118,6 +120,7 @@ sub processoutput { #This way, one arbiter handles output, no interrupting
|
||||
chomp($line);
|
||||
print $nodehdl{$readyh}.": ".$line."\n";
|
||||
}
|
||||
yield;
|
||||
return $rc;
|
||||
}
|
||||
sub scpnode {
|
||||
|
@ -13,6 +13,7 @@ if ($^O =~ /^linux/i) {
|
||||
use Data::Dumper;
|
||||
use IO::Handle;
|
||||
use IO::Select;
|
||||
use Threads qw(yield);
|
||||
use xCAT::Utils;
|
||||
use Getopt::Long;
|
||||
use POSIX qw(:signal_h :errno_h :sys_wait_h);
|
||||
@ -85,10 +86,11 @@ foreach (@nodes) {
|
||||
$inputs->add($child);
|
||||
$nodehdl{$child} = $node;
|
||||
}
|
||||
while ($children) {
|
||||
while ($inputs->count and $children) {
|
||||
processoutput($inputs);
|
||||
}
|
||||
while (processoutput($inputs)) {};
|
||||
wait;
|
||||
exit(0);
|
||||
|
||||
sub processoutput { #This way, one arbiter handles output, no interrupting
|
||||
@ -107,6 +109,7 @@ sub processoutput { #This way, one arbiter handles output, no interrupting
|
||||
chomp($line);
|
||||
print $nodehdl{$readyh}.": ".$line."\n";
|
||||
}
|
||||
yield;
|
||||
return $rc;
|
||||
}
|
||||
sub scpnode {
|
||||
|
Loading…
Reference in New Issue
Block a user