summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2016-06-20 19:19:16 +0300
committerDmitry Stogov <dmitry@zend.com>2016-06-20 19:19:16 +0300
commitc22a1c83f3421683b8386564d44cc1a10e4e93bd (patch)
tree040dfaab7c924b558b12365acf4de02d09a468e4 /sapi/phpdbg/phpdbg.c
parent8b823235d6814cf06259c98c652af252deef2a69 (diff)
downloadphp-git-c22a1c83f3421683b8386564d44cc1a10e4e93bd.tar.gz
Zend signals should be installed after request startup (or regular signals may be installed before zend_signal_startup)
Diffstat (limited to 'sapi/phpdbg/phpdbg.c')
-rw-r--r--sapi/phpdbg/phpdbg.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index e72b543a42..0a45882251 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -1657,14 +1657,6 @@ phpdbg_main:
} zend_end_try();
#endif
-#if defined(ZEND_SIGNALS) && !defined(_WIN32)
- zend_try { zend_sigaction(SIGSEGV, &signal_struct, &PHPDBG_G(old_sigsegv_signal)); } zend_end_try();
- zend_try { zend_sigaction(SIGBUS, &signal_struct, &PHPDBG_G(old_sigsegv_signal)); } zend_end_try();
-#elif !defined(_WIN32)
- sigaction(SIGSEGV, &signal_struct, &PHPDBG_G(old_sigsegv_signal));
- sigaction(SIGBUS, &signal_struct, &PHPDBG_G(old_sigsegv_signal));
-#endif
-
PHPDBG_G(sapi_name_ptr) = sapi_name;
if (exec) { /* set execution context */
@@ -1701,6 +1693,14 @@ phpdbg_main:
return 1;
}
+#if defined(ZEND_SIGNALS) && !defined(_WIN32)
+ zend_try { zend_sigaction(SIGSEGV, &signal_struct, &PHPDBG_G(old_sigsegv_signal)); } zend_end_try();
+ zend_try { zend_sigaction(SIGBUS, &signal_struct, &PHPDBG_G(old_sigsegv_signal)); } zend_end_try();
+#elif !defined(_WIN32)
+ sigaction(SIGSEGV, &signal_struct, &PHPDBG_G(old_sigsegv_signal));
+ sigaction(SIGBUS, &signal_struct, &PHPDBG_G(old_sigsegv_signal));
+#endif
+
/* do not install sigint handlers for remote consoles */
/* sending SIGINT then provides a decent way of shutting down the server */
#ifndef _WIN32