Skip to content

Commit 85a511d

Browse files
committed
fix zend signal and tsrm compat
1 parent 66770f9 commit 85a511d

File tree

8 files changed

+29
-4
lines changed

8 files changed

+29
-4
lines changed

Zend/zend.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -755,10 +755,6 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
755755
tsrm_set_new_thread_end_handler(zend_new_thread_end_handler);
756756
#endif
757757

758-
#ifdef ZEND_SIGNALS
759-
zend_signal_startup();
760-
#endif
761-
762758
return SUCCESS;
763759
}
764760
/* }}} */

sapi/apache2handler/sapi_apache2.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,11 @@ php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp
455455
(void)ts_resource(0);
456456
ZEND_TSRMLS_CACHE_UPDATE();
457457
#endif
458+
459+
#ifdef ZEND_SIGNALS
460+
zend_signal_startup();
461+
#endif
462+
458463
sapi_startup(&apache2_sapi_module);
459464
apache2_sapi_module.startup(&apache2_sapi_module);
460465
apr_pool_cleanup_register(pconf, NULL, php_apache_server_shutdown, apr_pool_cleanup_null);

sapi/cgi/cgi_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,6 +1773,10 @@ int main(int argc, char *argv[])
17731773
ZEND_TSRMLS_CACHE_UPDATE();
17741774
#endif
17751775

1776+
#ifdef ZEND_SIGNALS
1777+
zend_signal_startup();
1778+
#endif
1779+
17761780
#ifdef ZTS
17771781
ts_allocate_id(&php_cgi_globals_id, sizeof(php_cgi_globals_struct), (ts_allocate_ctor) php_cgi_globals_ctor, NULL);
17781782
#else

sapi/cli/php_cli.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,10 @@ int main(int argc, char *argv[])
12201220
ZEND_TSRMLS_CACHE_UPDATE();
12211221
#endif
12221222

1223+
#ifdef ZEND_SIGNALS
1224+
zend_signal_startup();
1225+
#endif
1226+
12231227
#ifdef PHP_WIN32
12241228
_fmode = _O_BINARY; /*sets default for file streams to binary */
12251229
setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */

sapi/embed/php_embed.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ EMBED_SAPI_API int php_embed_init(int argc, char **argv)
177177
ZEND_TSRMLS_CACHE_UPDATE();
178178
#endif
179179

180+
#ifdef ZEND_SIGNALS
181+
zend_signal_startup();
182+
#endif
183+
180184
sapi_startup(&php_embed_module);
181185

182186
#ifdef PHP_WIN32

sapi/fpm/fpm/fpm_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,6 +1589,10 @@ int main(int argc, char *argv[])
15891589
tsrm_ls = ts_resource(0);
15901590
#endif
15911591

1592+
#ifdef ZEND_SIGNALS
1593+
zend_signal_startup();
1594+
#endif
1595+
15921596
sapi_startup(&cgi_sapi_module);
15931597
cgi_sapi_module.php_ini_path_override = NULL;
15941598
cgi_sapi_module.php_ini_ignore_cwd = 1;

sapi/litespeed/lsapi_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,10 @@ int main( int argc, char * argv[] )
10051005
tsrm_startup(1, 1, 0, NULL);
10061006
#endif
10071007

1008+
#ifdef ZEND_SIGNALS
1009+
zend_signal_startup();
1010+
#endif
1011+
10081012
if (argc > 1 ) {
10091013
if ( parse_opt( argc, argv, &climode,
10101014
&php_ini_path, &php_bind ) == -1 ) {

sapi/phpdbg/phpdbg.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,10 @@ int main(int argc, char **argv) /* {{{ */
13321332
tsrm_ls = ts_resource(0);
13331333
#endif
13341334

1335+
#ifdef ZEND_SIGNALS
1336+
zend_signal_startup();
1337+
#endif
1338+
13351339
phpdbg_main:
13361340
ini_entries = NULL;
13371341
ini_entries_len = 0;

0 commit comments

Comments
 (0)