File apache2-core-prefork-run-new-hook-child_stopped-only-on-clea.patch of Package apache2.35278

From 18ddb6670b86805570f74b217a2206c66a3b6413 Mon Sep 17 00:00:00 2001
From: Stefan Eissing <icing@apache.org>
Date: Thu, 24 Feb 2022 16:59:31 +0000
Subject: [PATCH]   *) core/prefork: run new hook `child_stopped` only on clean
 exit.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898381 13f79535-47bb-0310-9956-ffa450edef68
---
 server/mpm/prefork/prefork.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Index: httpd-2.4.51/server/mpm/prefork/prefork.c
===================================================================
--- httpd-2.4.51.orig/server/mpm/prefork/prefork.c
+++ httpd-2.4.51/server/mpm/prefork/prefork.c
@@ -223,12 +223,12 @@ static void clean_child_exit(int code)
     apr_signal(SIGHUP, SIG_IGN);
     apr_signal(SIGTERM, SIG_IGN);
 
-    if (code == 0) {
-        ap_run_child_stopping(pchild, 0);
-    }
 
     if (pchild) {
-        ap_run_child_stopped(pchild, 0);
+        if (code == 0) {
+            ap_run_child_stopping(pchild, 0);
+            ap_run_child_stopped(pchild, 0);
+        }
         apr_pool_destroy(pchild);
     }
 
openSUSE Build Service is sponsored by