Skip to content

Commit ca9e789

Browse files
committed
Fix ext/pcntl
1 parent a6450da commit ca9e789

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

ext/pcntl/pcntl.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ PHP_RSHUTDOWN_FUNCTION(pcntl)
238238

239239
/* Reset all signals to their default disposition */
240240
ZEND_HASH_FOREACH_NUM_KEY_VAL(&PCNTL_G(php_signal_table), signo, handle) {
241-
if (Z_TYPE_P(handle) != IS_LONG || Z_LVAL_P(handle) != (zend_long)SIG_DFL) {
242-
php_signal(signo, (Sigfunc *)(zend_long)SIG_DFL, 0);
241+
if (Z_TYPE_P(handle) != IS_LONG || Z_LVAL_P(handle) != (zend_long)(intptr_t)SIG_DFL) {
242+
php_signal(signo, (Sigfunc *)(intptr_t)SIG_DFL, 0);
243243
}
244244
} ZEND_HASH_FOREACH_END();
245245

@@ -825,11 +825,11 @@ PHP_FUNCTION(pcntl_signal)
825825

826826
/* Special long value case for SIG_DFL and SIG_IGN */
827827
if (Z_TYPE_P(handle) == IS_LONG) {
828-
if (Z_LVAL_P(handle) != (zend_long) SIG_DFL && Z_LVAL_P(handle) != (zend_long) SIG_IGN) {
828+
if (Z_LVAL_P(handle) != (zend_long)(intptr_t)SIG_DFL && Z_LVAL_P(handle) != (zend_long)(intptr_t)SIG_IGN) {
829829
zend_argument_value_error(2, "must be either SIG_DFL or SIG_IGN when an integer value is given");
830830
RETURN_THROWS();
831831
}
832-
if (php_signal(signo, (Sigfunc *) Z_LVAL_P(handle), (int) restart_syscalls) == (void *)SIG_ERR) {
832+
if (php_signal(signo, (Sigfunc *)(intptr_t)Z_LVAL_P(handle), (int) restart_syscalls) == (void *)SIG_ERR) {
833833
PCNTL_G(last_error) = errno;
834834
php_error_docref(NULL, E_WARNING, "Error assigning signal");
835835
RETURN_FALSE;
@@ -885,7 +885,7 @@ PHP_FUNCTION(pcntl_signal_get_handler)
885885
if ((prev_handle = zend_hash_index_find(&PCNTL_G(php_signal_table), signo)) != NULL) {
886886
RETURN_COPY(prev_handle);
887887
} else {
888-
RETURN_LONG((zend_long)SIG_DFL);
888+
RETURN_LONG((zend_long)(intptr_t)SIG_DFL);
889889
}
890890
}
891891

@@ -1151,11 +1151,11 @@ static void pcntl_siginfo_to_zval(int signo, siginfo_t *siginfo, zval *user_sigi
11511151
case SIGFPE:
11521152
case SIGSEGV:
11531153
case SIGBUS:
1154-
add_assoc_double_ex(user_siginfo, "addr", sizeof("addr")-1, (zend_long)siginfo->si_addr);
1154+
add_assoc_double_ex(user_siginfo, "addr", sizeof("addr")-1, (zend_long)(intptr_t)siginfo->si_addr);
11551155
break;
11561156
#if defined(SIGPOLL) && !defined(__CYGWIN__)
11571157
case SIGPOLL:
1158-
add_assoc_long_ex(user_siginfo, "band", sizeof("band")-1, siginfo->si_band);
1158+
add_assoc_long_ex(user_siginfo, "band", sizeof("band")-1, (zend_long)(intptr_t)siginfo->si_band);
11591159
# ifdef si_fd
11601160
add_assoc_long_ex(user_siginfo, "fd", sizeof("fd")-1, siginfo->si_fd);
11611161
# endif

ext/pcntl/pcntl.stub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,17 @@
108108

109109
/**
110110
* @var int
111-
* @cvalue LONG_CONST(SIG_IGN)
111+
* @cvalue LONG_CONST((intptr_t)SIG_IGN)
112112
*/
113113
const SIG_IGN = UNKNOWN;
114114
/**
115115
* @var int
116-
* @cvalue LONG_CONST(SIG_DFL)
116+
* @cvalue LONG_CONST((intptr_t)SIG_DFL)
117117
*/
118118
const SIG_DFL = UNKNOWN;
119119
/**
120120
* @var int
121-
* @cvalue LONG_CONST(SIG_ERR)
121+
* @cvalue LONG_CONST((intptr_t)SIG_ERR)
122122
*/
123123
const SIG_ERR = UNKNOWN;
124124
/**

ext/pcntl/pcntl_arginfo.h

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)