diff --git a/mongoose.c b/mongoose.c
index 5ec26df21135cd3e350089570a7b414925b64209..634e80543dbfbe0fd8cab17094987689761bbc1e 100644
--- a/mongoose.c
+++ b/mongoose.c
@@ -7873,7 +7873,7 @@ static int mg_start_process(const char *interp, const char *cmd,
              interp == NULL ? "" : interp, interp == NULL ? "" : " ", cmd,
              strerror(errno));
     send(1, buf, strlen(buf), 0);
-    exit(EXIT_FAILURE); /* exec call failed */
+    _exit(EXIT_FAILURE); /* exec call failed */
   }
 
   return (pid != 0);