summaryrefslogtreecommitdiff
path: root/mysql-test/lib/My/SafeProcess.pm
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2010-10-19 15:58:35 +0200
committerSergei Golubchik <sergii@pisem.net>2010-10-19 15:58:35 +0200
commit745cc74c3301f193c7b82c31d11c3bf0c842be9e (patch)
tree4aa6101c051c91607d2623eed26fb41527fd0bd3 /mysql-test/lib/My/SafeProcess.pm
parentf0c6576b85a57ec82fd911f73cce7c99683b378c (diff)
parentcc6d22f5356e0969d8d5d1046edc69cb17ea19fb (diff)
downloadmariadb-git-745cc74c3301f193c7b82c31d11c3bf0c842be9e.tar.gz
5.1.51 merge
Diffstat (limited to 'mysql-test/lib/My/SafeProcess.pm')
-rw-r--r--mysql-test/lib/My/SafeProcess.pm15
1 files changed, 14 insertions, 1 deletions
diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm
index 084ef408d5b..bdd6c7352ae 100644
--- a/mysql-test/lib/My/SafeProcess.pm
+++ b/mysql-test/lib/My/SafeProcess.pm
@@ -60,11 +60,12 @@ use My::Platform;
my %running;
my $_verbose= 0;
+my $start_exit= 0;
END {
# Kill any children still running
for my $proc (values %running){
- if ( $proc->is_child($$) ){
+ if ( $proc->is_child($$) and ! $start_exit){
#print "Killing: $proc\n";
if ($proc->wait_one(0)){
$proc->kill();
@@ -149,6 +150,11 @@ sub new {
push(@safe_args, "--");
push(@safe_args, $path); # The program safe_process should execute
+
+ if ($start_exit) { # Bypass safe_process instead, start program directly
+ @safe_args= ();
+ $safe_path= $path;
+ }
push(@safe_args, @$$args);
print "### safe_path: ", $safe_path, " ", join(" ", @safe_args), "\n"
@@ -534,6 +540,13 @@ sub wait_all {
}
}
+#
+# Set global flag to tell all safe_process to exit after starting child
+#
+
+sub start_exit {
+ $start_exit= 1;
+}
#
# Check if any process has exited, but don't wait.