Prevent child reapers from trouncing accurate syscall errno settings

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16597 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2013-06-10 14:42:25 +00:00
parent 11e2d1e834
commit 20b3960c09

View File

@ -823,6 +823,7 @@ $dbmaster=xCAT::Table::init_dbworker;
my $CHILDPID=0; #Global for reapers
my %immediatechildren;
sub generic_reaper {
local($!);
while (($CHILDPID=waitpid(-1,WNOHANG)) > 0) {
yield;
}
@ -830,6 +831,7 @@ sub generic_reaper {
}
sub ssl_reaper {
local($!);
my $numdone = 0;
while (($CHILDPID=waitpid(-1,WNOHANG)) > 0) {
if ($immediatechildren{$CHILDPID}) {
@ -843,6 +845,7 @@ sub ssl_reaper {
}
sub dispatch_reaper {
local($!);
while (($CHILDPID =waitpid(-1, WNOHANG)) > 0) {
if ($dispatched_children{$CHILDPID}) {
delete $dispatched_children{$CHILDPID};
@ -853,6 +856,7 @@ sub dispatch_reaper {
}
sub plugin_reaper {
local($!);
while (($CHILDPID = waitpid(-1, WNOHANG)) > 0) {
if ($plugin_children{$CHILDPID}) {
delete $plugin_children{$CHILDPID};