php-pcntl: php{74,80} fix [-Wincompatible-function-pointer-types] in ext/pcntl/pcntl.c

This commit is contained in:
BjarneDMat
2026-04-22 03:10:30 +02:00
committed by Renee Otten
parent 0c54572cb4
commit 97b3e95a11
3 changed files with 67 additions and 0 deletions
+5
View File
@@ -2034,6 +2034,11 @@ subport ${php}-pcntl {
long_description ${description}
patch.pre_args-replace -p0 -p1
if {[vercmp ${branch} <= 8.0]} {
patchfiles-append patch-${php}-ext-pcntl-pcntl.c.diff
}
notes "
${subport} should not be enabled within a web server environment.\
Unexpected results may occur if any process control functions are used within\
@@ -0,0 +1,31 @@
--- a/ext/pcntl/pcntl.c 2026-04-22 02:56:42
+++ b/ext/pcntl/pcntl.c 2026-04-22 02:57:03
@@ -253,6 +253,7 @@
static void pcntl_signal_handler(int);
#endif
static void pcntl_signal_dispatch();
+static void pcntl_signal_dispatch_tick_function(int dummy_int, void *dummy_pointer);
static void pcntl_interrupt_function(zend_execute_data *execute_data);
void php_register_signal_constants(INIT_FUNC_ARGS)
@@ -587,7 +588,7 @@
PHP_RINIT_FUNCTION(pcntl)
{
- php_add_tick_function(pcntl_signal_dispatch, NULL);
+ php_add_tick_function(pcntl_signal_dispatch_tick_function, NULL);
zend_hash_init(&PCNTL_G(php_signal_table), 16, NULL, ZVAL_PTR_DTOR, 0);
PCNTL_G(head) = PCNTL_G(tail) = PCNTL_G(spares) = NULL;
PCNTL_G(async_signals) = 0;
@@ -1547,6 +1548,11 @@
/* return signal mask to previous state */
sigprocmask(SIG_SETMASK, &old_mask, NULL);
+}
+
+static void pcntl_signal_dispatch_tick_function(int dummy_int, void *dummy_pointer)
+{
+ return pcntl_signal_dispatch();
}
/* {{{ proto bool pcntl_async_signals([bool on[)
@@ -0,0 +1,31 @@
--- a/ext/pcntl/pcntl.c 2026-04-22 02:48:38
+++ b/ext/pcntl/pcntl.c 2026-04-22 02:48:54
@@ -90,6 +90,7 @@
static void pcntl_signal_handler(int);
#endif
static void pcntl_signal_dispatch();
+static void pcntl_signal_dispatch_tick_function(int dummy_int, void *dummy_pointer);
static void pcntl_interrupt_function(zend_execute_data *execute_data);
void php_register_signal_constants(INIT_FUNC_ARGS)
@@ -426,7 +427,7 @@
PHP_RINIT_FUNCTION(pcntl)
{
- php_add_tick_function(pcntl_signal_dispatch, NULL);
+ php_add_tick_function(pcntl_signal_dispatch_tick_function, NULL);
zend_hash_init(&PCNTL_G(php_signal_table), 16, NULL, ZVAL_PTR_DTOR, 0);
PCNTL_G(head) = PCNTL_G(tail) = PCNTL_G(spares) = NULL;
PCNTL_G(async_signals) = 0;
@@ -1385,6 +1386,11 @@
/* return signal mask to previous state */
sigprocmask(SIG_SETMASK, &old_mask, NULL);
+}
+
+static void pcntl_signal_dispatch_tick_function(int dummy_int, void *dummy_pointer)
+{
+ return pcntl_signal_dispatch();
}
/* {{{ Enable/disable asynchronous signal handling and return the old setting. */