94399e0
diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c
fd6452a
index 559f90a..a386a75 100644
94399e0
--- a/server/mpm/prefork/prefork.c
94399e0
+++ b/server/mpm/prefork/prefork.c
fd6452a
@@ -220,6 +220,9 @@ static void clean_child_exit(int code)
94399e0
 {
fd6452a
     retained->mpm->mpm_state = AP_MPMQ_STOPPING;
94399e0
 
94399e0
+    apr_signal(SIGHUP, SIG_IGN);
94399e0
+    apr_signal(SIGTERM, SIG_IGN);
94399e0
+
94399e0
     if (pchild) {
94399e0
         apr_pool_destroy(pchild);
94399e0
     }
fd6452a
@@ -699,6 +702,13 @@ static int make_child(server_rec *s, int slot, int bucket)
94399e0
          */
94399e0
         apr_signal(SIGHUP, just_die);
94399e0
         apr_signal(SIGTERM, just_die);
94399e0
+        /* Ignore SIGINT in child. This fixes race-condition in signals
94399e0
+         * handling when httpd is runnning on foreground and user hits ctrl+c.
94399e0
+         * In this case, SIGINT is sent to all children followed by SIGTERM
94399e0
+         * from the main process, which interrupts the SIGINT handler and
94399e0
+         * leads to inconsistency.
94399e0
+         */
94399e0
+        apr_signal(SIGINT, SIG_IGN);
94399e0
         /* The child process just closes listeners on AP_SIG_GRACEFUL.
94399e0
          * The pod is used for signalling the graceful restart.
94399e0
          */