summaryrefslogtreecommitdiff
path: root/sapi/cgi/cgi_main.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2006-02-03 16:30:09 +0000
committerDmitry Stogov <dmitry@php.net>2006-02-03 16:30:09 +0000
commitaa1142eded6e52740146fa6b41bbb60c8aeb571c (patch)
tree3b44a13116b11b9f37c1a12bbb5aba0db9e0237d /sapi/cgi/cgi_main.c
parent52232a7f7aaeb72e25f0134ac9142cfb3f6795d9 (diff)
downloadphp-git-aa1142eded6e52740146fa6b41bbb60c8aeb571c.tar.gz
Fixed bug #36158 (SIGTERM is not handled correctly when running as a FastCGI server)
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();