Author: arkurth
Date: Wed Dec 17 08:58:36 2008
New Revision: 727437

URL: http://svn.apache.org/viewvc?rev=727437&view=rev
Log:
Fixed a bug in vcld::REAPER. It was capturing $? at the beginning of the 
subroutine but not setting this variable back to its initial value when the sub 
was done.  It was setting $? to the child process exit status ($? >> 8).

Modified:
    incubator/vcl/trunk/managementnode/bin/vcld

Modified: incubator/vcl/trunk/managementnode/bin/vcld
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/bin/vcld?rev=727437&r1=727436&r2=727437&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/bin/vcld (original)
+++ incubator/vcl/trunk/managementnode/bin/vcld Wed Dec 17 08:58:36 2008
@@ -664,9 +664,11 @@
        # Save the information saved in $? before proceeding
        # This is done to save the exit status of the child process which died
        # If you don't save it, wait() will overwrite it
+       my $status_save = $?;
        my $child_exit_status = $? >> 8;
        my $signal_number = $? & 127;
        my $dumped_core = $? & 128;
+       #notify($ERRORS{'DEBUG'}, 0, "\$?: $?, signal: $signal_number, dumped 
core: $dumped_core, child exit status: $child_exit_status");
        
        # Configure the REAPER() subroutine to handle SIGCHLD signals
        $SIG{CHLD} = \&REAPER;
@@ -684,13 +686,13 @@
        }
        else {
                # Child which died was some other process
-               notify($ERRORS{'DEBUG'}, $LOGFILE, "child process exited, 
pid=$dead_pid");
+               #notify($ERRORS{'DEBUG'}, $LOGFILE, "child process exited, 
pid=$dead_pid");
        }
        
        # Set the special $? variable back to the exit status of the child 
which died
        # This is useful when utilities such as SSH are run in other places in 
the code
        # The code which called the utility can check the exit status to see if 
it was successful
-       $? = $child_exit_status;
+       $? = $status_save;
        
        return;
 } ## end sub REAPER


Reply via email to