Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'xdebug_2_5'
  • Loading branch information
derickr committed Apr 18, 2017
2 parents d400683 + a5f94d9 commit 98e88ef
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions xdebug.c
Expand Up @@ -1170,8 +1170,12 @@ PHP_RINIT_FUNCTION(xdebug)

/* Override pcntl_exec with our own function to be able to write profiling summary */
orig = zend_hash_str_find_ptr(EG(function_table), "pcntl_exec", sizeof("pcntl_exec") - 1);
XG(orig_pcntl_exec_func) = orig->internal_function.handler;
orig->internal_function.handler = zif_xdebug_pcntl_exec;
if (orig) {
XG(orig_pcntl_exec_func) = orig->internal_function.handler;
orig->internal_function.handler = zif_xdebug_pcntl_exec;
} else {
XG(orig_pcntl_exec_func) = NULL;
}

XG(headers) = xdebug_llist_alloc(xdebug_llist_string_dtor);

Expand Down Expand Up @@ -1273,8 +1277,12 @@ ZEND_MODULE_POST_ZEND_DEACTIVATE_D(xdebug)
orig = zend_hash_str_find_ptr(EG(function_table), "set_time_limit", sizeof("set_time_limit") - 1);
orig->internal_function.handler = XG(orig_set_time_limit_func);;

orig = zend_hash_str_find_ptr(EG(function_table), "pcntl_exec", sizeof("pcntl_exec") - 1);
orig->internal_function.handler = XG(orig_pcntl_exec_func);
if (XG(orig_pcntl_exec_func)) {
orig = zend_hash_str_find_ptr(EG(function_table), "pcntl_exec", sizeof("pcntl_exec") - 1);
if (orig) {
orig->internal_function.handler = XG(orig_pcntl_exec_func);
}
}

/* Clean up collected headers */
xdebug_llist_destroy(XG(headers), NULL);
Expand Down

0 comments on commit 98e88ef

Please sign in to comment.