while (PCNTL_G(head)) {
sig = PCNTL_G(head);
PCNTL_G(head) = sig->next;
-#ifdef HAVE_STRUCT_SIGINFO_T
- if (sig->siginfo) {
- zend_array_destroy(sig->siginfo);
- }
-#endif
efree(sig);
}
while (PCNTL_G(spares)) {
psig->next = NULL;
#ifdef HAVE_STRUCT_SIGINFO_T
- zval user_siginfo;
- array_init(&user_siginfo);
- pcntl_siginfo_to_zval(signo, siginfo, &user_siginfo);
- psig->siginfo = zend_array_dup(Z_ARRVAL(user_siginfo));
- zval_ptr_dtor(&user_siginfo);
+ psig->siginfo = *siginfo;
#endif
/* the head check is important, as the tick handler cannot atomically clear both
PCNTL_G(head) = NULL; /* simple stores are atomic */
/* Allocate */
-
while (queue) {
if ((handle = zend_hash_index_find(&PCNTL_G(php_signal_table), queue->signo)) != NULL) {
if (Z_TYPE_P(handle) != IS_LONG) {
ZVAL_NULL(&retval);
ZVAL_LONG(¶ms[0], queue->signo);
#ifdef HAVE_STRUCT_SIGINFO_T
- ZVAL_ARR(¶ms[1], queue->siginfo);
+ array_init(¶ms[1]);
+ pcntl_siginfo_to_zval(queue->signo, &queue->siginfo, ¶ms[1]);
#else
ZVAL_NULL(¶ms[1]);
#endif