summaryrefslogtreecommitdiff
path: root/sapi/cgi/cgi_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/cgi/cgi_main.c')
-rw-r--r--sapi/cgi/cgi_main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index ac60c08d46..3d33dff573 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -274,7 +274,7 @@ static void sapi_cgibin_flush(void *server_context)
#ifndef PHP_WIN32
!parent &&
#endif
- (!request || FCGX_FFlush(request->out) == -1)) {
+ request && FCGX_FFlush(request->out) == -1) {
php_handle_aborted_connection();
}
return;
@@ -1242,7 +1242,8 @@ consult the installation file that came with this distribution, or visit \n\
#ifdef DEBUG_FASTCGI
fprintf(stderr, "Wait for kids, pid %d\n", getpid());
#endif
- wait(&status);
+ while (wait(&status) < 0) {
+ }
running--;
}
}
@@ -1656,6 +1657,7 @@ fastcgi_request_done:
exit_status = 255;
} zend_end_try();
+ SG(server_context) = NULL;
php_module_shutdown(TSRMLS_C);
sapi_shutdown();