Francois Gouget : testbot: Rename DBIBackEnd::PrepareForFork() to Close().

Alexandre Julliard julliard at winehq.org
Tue Oct 3 02:43:56 CDT 2017


Module: tools
Branch: master
Commit: 540136bbd6898e7b913e39016a088059896f8b20
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=540136bbd6898e7b913e39016a088059896f8b20

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue Oct  3 03:26:36 2017 +0200

testbot: Rename DBIBackEnd::PrepareForFork() to Close().

It can also be useful after the fork() and before the exec() so a more
generic name describing what it does is more appropriate.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/bin/Engine.pl                 | 4 +++-
 testbot/lib/ObjectModel/DBIBackEnd.pm | 2 +-
 testbot/lib/WineTestBot/Tasks.pm      | 4 +++-
 testbot/lib/WineTestBot/VMs.pm        | 4 +++-
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/testbot/bin/Engine.pl b/testbot/bin/Engine.pl
index 6dddc8f..6a05277 100755
--- a/testbot/bin/Engine.pl
+++ b/testbot/bin/Engine.pl
@@ -280,7 +280,9 @@ sub HandleJobStatusChange($$$)
 
   if ($OldStatus eq "running" && $NewStatus ne "running")
   {
-    $ActiveBackEnds{'WineTestBot'}->PrepareForFork();
+    # Make sure the child process does not inherit the database connection
+    $ActiveBackEnds{'WineTestBot'}->Close();
+
     my $Pid = fork;
     if (!defined $Pid)
     {
diff --git a/testbot/lib/ObjectModel/DBIBackEnd.pm b/testbot/lib/ObjectModel/DBIBackEnd.pm
index d65182d..4082a0a 100644
--- a/testbot/lib/ObjectModel/DBIBackEnd.pm
+++ b/testbot/lib/ObjectModel/DBIBackEnd.pm
@@ -565,7 +565,7 @@ sub DeleteAll($$)
   return undef;
 }
 
-sub PrepareForFork($)
+sub Close($)
 {
   my ($self) = @_;
 
diff --git a/testbot/lib/WineTestBot/Tasks.pm b/testbot/lib/WineTestBot/Tasks.pm
index 900498a..520d403 100644
--- a/testbot/lib/WineTestBot/Tasks.pm
+++ b/testbot/lib/WineTestBot/Tasks.pm
@@ -99,7 +99,9 @@ sub Run($$)
     $RunScript = "RunTask.pl";
   }
 
-  $self->GetBackEnd()->PrepareForFork();
+  # Make sure the child process does not inherit the database connection
+  $self->GetBackEnd()->Close();
+
   my $Pid = fork;
   if (!defined $Pid)
   {
diff --git a/testbot/lib/WineTestBot/VMs.pm b/testbot/lib/WineTestBot/VMs.pm
index dafce67..d6bb537 100644
--- a/testbot/lib/WineTestBot/VMs.pm
+++ b/testbot/lib/WineTestBot/VMs.pm
@@ -516,7 +516,9 @@ sub RunRevert($)
   my ($ErrProperty, $ErrMessage) = $self->Save();
   return $ErrMessage if (defined $ErrMessage);
 
-  $self->GetBackEnd()->PrepareForFork();
+  # Make sure the child process does not inherit the database connection
+  $self->GetBackEnd()->Close();
+
   my $Pid = fork;
   if (!defined $Pid)
   {




More information about the wine-cvs mailing list