Browse Source

signal handling fix

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@65 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.1
Xuefer 15 years ago
parent
commit
83fcc46da1
  1. 16
      xcache.c

16
xcache.c

@ -1721,9 +1721,9 @@ static function_entry xcache_functions[] = /* {{{ */
/* signal handler */
static void (*original_sigsegv_handler)(int) = NULL;
static void xcache_sigsegv_handler(int dummy) /* {{{ */
static void xcache_sigsegv_handler(int sig) /* {{{ */
{
if (original_sigsegv_handler == xcache_sigsegv_handler) {
if (original_sigsegv_handler != xcache_sigsegv_handler) {
signal(SIGSEGV, original_sigsegv_handler);
}
else {
@ -1732,9 +1732,7 @@ static void xcache_sigsegv_handler(int dummy) /* {{{ */
if (xc_coredump_dir && xc_coredump_dir[0]) {
chdir(xc_coredump_dir);
}
if (original_sigsegv_handler != xcache_sigsegv_handler) {
original_sigsegv_handler(dummy);
}
raise(sig);
}
/* }}} */
@ -1901,7 +1899,9 @@ static PHP_MINIT_FUNCTION(xcache)
xc_var_size = xc_var_hcache.size = 0;
}
original_sigsegv_handler = signal(SIGSEGV, xcache_sigsegv_handler);
if (xc_coredump_dir && xc_coredump_dir[0]) {
original_sigsegv_handler = signal(SIGSEGV, xcache_sigsegv_handler);
}
xc_init_constant(module_number TSRMLS_CC);
@ -1939,7 +1939,9 @@ static PHP_MSHUTDOWN_FUNCTION(xcache)
xc_coverager_destroy();
#endif
signal(SIGSEGV, original_sigsegv_handler);
if (xc_coredump_dir && xc_coredump_dir[0]) {
signal(SIGSEGV, original_sigsegv_handler);
}
if (xc_coredump_dir) {
pefree(xc_coredump_dir, 1);
xc_coredump_dir = NULL;

Loading…
Cancel
Save