summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Wang <gwang@php.net>2019-11-21 17:59:05 -0500
committerGeorge Wang <gwang@php.net>2019-11-21 17:59:05 -0500
commit8a977e07d08b9a035236002c07ee424b61281635 (patch)
treebf4c2c842b349b366a627bee64162423d17147a6
parent424d34d1c0390d51e6b5eb0978644554453c6b16 (diff)
parent99b8e67615159fc600a615e1e97f2d1cf18f14cb (diff)
downloadphp-git-8a977e07d08b9a035236002c07ee424b61281635.tar.gz
Merge branch 'PHP-7.4'
-rw-r--r--sapi/litespeed/lsapi_main.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index 54cd2893d1..c7da14f85b 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -601,7 +601,7 @@ static int sapi_lsapi_activate()
static sapi_module_struct lsapi_sapi_module =
{
"litespeed",
- "LiteSpeed V7.5",
+ "LiteSpeed V7.6",
php_lsapi_startup, /* startup */
php_module_shutdown_wrapper, /* shutdown */
@@ -678,6 +678,8 @@ static void lsapi_sigsegv( int signal )
_exit(1);
}
+static int do_clean_shutdown = 1;
+
static int clean_onexit = 1;
@@ -753,18 +755,20 @@ static int lsapi_module_main(int show_source)
return -1;
}
- sigemptyset(&act.sa_mask);
- act.sa_flags = SA_NODEFER;
- act.sa_handler = lsapi_sigterm;
- sa_rc = sigaction( SIGINT, &act, NULL);
- sa_rc = sigaction( SIGQUIT, &act, NULL);
- sa_rc = sigaction( SIGILL, &act, NULL);
- sa_rc = sigaction( SIGABRT, &act, NULL);
- sa_rc = sigaction( SIGBUS, &act, NULL);
- sa_rc = sigaction( SIGSEGV, &act, NULL);
- sa_rc = sigaction( SIGTERM, &act, NULL);
-
- clean_onexit = 0;
+ if (do_clean_shutdown) {
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = SA_NODEFER;
+ act.sa_handler = lsapi_sigterm;
+ sa_rc = sigaction( SIGINT, &act, NULL);
+ sa_rc = sigaction( SIGQUIT, &act, NULL);
+ sa_rc = sigaction( SIGILL, &act, NULL);
+ sa_rc = sigaction( SIGABRT, &act, NULL);
+ sa_rc = sigaction( SIGBUS, &act, NULL);
+ sa_rc = sigaction( SIGSEGV, &act, NULL);
+ sa_rc = sigaction( SIGTERM, &act, NULL);
+
+ clean_onexit = 0;
+ }
if (show_source) {
zend_syntax_highlighter_ini syntax_highlighter_ini;
@@ -1567,7 +1571,8 @@ int main( int argc, char * argv[] )
int result;
- atexit(lsapi_atexit);
+ if (do_clean_shutdown)
+ atexit(lsapi_atexit);
while( ( result = LSAPI_Prefork_Accept_r( &g_req )) >= 0 ) {
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
@@ -1641,6 +1646,13 @@ static PHP_MINIT_FUNCTION(litespeed)
if (p && 0 == strcasecmp(p, "on"))
parse_user_ini = 1;
+ p = getenv("LSAPI_CLEAN_SHUTDOWN");
+ if (p) {
+ if (*p == '1' || 0 == strcasecmp(p, "on"))
+ do_clean_shutdown = 1;
+ else if (*p == '0' || 0 == strcasecmp(p, "off"))
+ do_clean_shutdown = 0;
+ }
/*
* mod_lsapi always sets this env var,
* so we can detect mod_lsapi mode with its presense.