]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix a visual glitch in test_cmp_http.t
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 21 Mar 2025 19:58:57 +0000 (20:58 +0100)
committerTomas Mraz <tomas@openssl.org>
Wed, 2 Apr 2025 17:42:49 +0000 (19:42 +0200)
Kill the shell process after the Mock server is running,
to prevent the shell from printing an error message when
the Mock server is finally killed.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27144)

(cherry picked from commit c45f0dd80370f1aa942cf47fc5ea99cb887621e4)

test/recipes/80-test_cmp_http.t

index 36d7f372faa21f4738e88b3577f109e34a4aa0b8..b3d104861d09a072e9dd9260569e3085bb79674e 100644 (file)
@@ -328,7 +328,7 @@ sub start_server {
     if ($server_host eq '*' || $server_port == 0) {
         # Find out the actual server host and port and possibly different PID
         my ($host, $port);
-        $pid = 0;
+        my $pid0 = $pid;
         while (<$server_fh>) {
             print "$server_name server output: $_";
             next if m/using section/;
@@ -342,6 +342,11 @@ sub start_server {
             $server_host = "127.0.0.1" if $host eq "0.0.0.0";
         }
         $server_port = $port if $server_port == 0 && defined $port;
+        if ($pid0 != $pid) {
+            # kill the shell process
+            kill('KILL', $pid0);
+            waitpid($pid0, 0);
+        }
     }
     if ($server_host eq '*' || $server_port == 0) {
         stop_server($server_name, $pid) if $pid;