PerconaTest::full_output: Fix a bug in the returned status

This commit is contained in:
Brian Fraser fraserb@gmail.com
2012-06-07 17:43:50 -03:00
parent aa42210f72
commit 63b31873e5

View File

@@ -725,7 +725,6 @@ sub full_output {
*STDERR = *STDOUT; *STDERR = *STDOUT;
my $status; my $status;
warn $file;
if (my $pid = fork) { if (my $pid = fork) {
if ( my $t = $args{wait_for} ) { if ( my $t = $args{wait_for} ) {
# Wait for t seconds then kill the child. # Wait for t seconds then kill the child.
@@ -741,11 +740,10 @@ sub full_output {
sleep 0.25; sleep 0.25;
} }
waitpid($pid, 0); waitpid($pid, 0);
$status = $?; $status = $? >> 8;
} }
else { else {
$code->(); exit $code->();
exit 0;
} }
close *output_fh; close *output_fh;
my $output = do { local $/; open my $fh, "<", $file or die $!; <$fh> }; my $output = do { local $/; open my $fh, "<", $file or die $!; <$fh> };