aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2006-11-18 04:07:01 +0000
committerYang Tse <yangsita@gmail.com>2006-11-18 04:07:01 +0000
commit0b5e1a9b2ff0cc52318ac9ec1c054eae2d1ffc70 (patch)
tree9110ec6c59b1a0e7920e507c4bc691bb2e6128df
parent2e17a9747470be98b3d7e2cef3a918bd5249f279 (diff)
Avoid keeping dupe pids When forked pid and test server pid is the same one.
-rwxr-xr-xtests/runtests.pl11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 7b4196d54..ccdb8314f 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -283,11 +283,16 @@ sub startnew {
# setup entry in the running servers hash
- $run{$serv}{'pidfile'} = $pidfile; # pidfile for the test server.
+ $run{$serv}{'pidfile'} = $pidfile; # pidfile for the test server.
- $run{$serv}{'pids'} = "$child $pid2"; # forked pid and test server pid.
+ if($child == $pid2) {
+ $run{$serv}{'pids'} = "$pid2"; # test server pid.
+ }
+ else {
+ $run{$serv}{'pids'} = "$child $pid2"; # forked pid and test server pid.
+ }
- if($serv =~ /^ftp(\d*)(-ipv6|)/) { # ftp servers have slavepidfiles.
+ if($serv =~ /^ftp(\d*)(-ipv6|)/) { # ftp servers have slavepidfiles.
my ($id, $ext) = ($1, $2);
$ext =~ s/\-//g;
my $slavepidfiles = ".sockfilt$id$ext.pid .sockdata$id$ext.pid";