]> granicus.if.org Git - curl/commitdiff
Avoid keeping dupe pids When forked pid and test server pid is the same one.
authorYang Tse <yangsita@gmail.com>
Sat, 18 Nov 2006 04:07:01 +0000 (04:07 +0000)
committerYang Tse <yangsita@gmail.com>
Sat, 18 Nov 2006 04:07:01 +0000 (04:07 +0000)
tests/runtests.pl

index 7b4196d54f07b8a6d0e185cdd76bb30ad4395bc9..ccdb8314fd818939ad7f221979b4a174a2892d68 100755 (executable)
@@ -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";