]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix a visual glitch in test_cmp_http.t 26979/head
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:33 +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)

test/recipes/80-test_cmp_http.t

index 39f3a54dd292f443cc45631ecd868cdb40471840..63b25259f58566b3aa40239056551ddc2a763bb9 100644 (file)
@@ -330,7 +330,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/;
@@ -344,6 +344,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;