diff options
-rw-r--r-- | ext/pcntl/pcntl.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index 886099c573..0884aac616 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -756,12 +756,14 @@ PHP_FUNCTION(pcntl_wifexited) { #ifdef WIFEXITED zend_long status_word; + int int_status_word; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) { return; } - if (WIFEXITED((int)status_word)) + int_status_word = (int) status_word; + if (WIFEXITED(int_status_word)) RETURN_TRUE; #endif @@ -775,12 +777,14 @@ PHP_FUNCTION(pcntl_wifstopped) { #ifdef WIFSTOPPED zend_long status_word; + int int_status_word; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) { return; } - if (WIFSTOPPED((int)status_word)) + int_status_word = (int) status_word; + if (WIFSTOPPED(int_status_word)) RETURN_TRUE; #endif RETURN_FALSE; @@ -793,12 +797,14 @@ PHP_FUNCTION(pcntl_wifsignaled) { #ifdef WIFSIGNALED zend_long status_word; + int int_status_word; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) { return; } - if (WIFSIGNALED((int)status_word)) + int_status_word = (int) status_word; + if (WIFSIGNALED(int_status_word)) RETURN_TRUE; #endif RETURN_FALSE; @@ -810,12 +816,14 @@ PHP_FUNCTION(pcntl_wifcontinued) { #ifdef HAVE_WCONTINUED zend_long status_word; + int int_status_word; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) { return; } - if (WIFCONTINUED((int)status_word)) + int_status_word = (int) status_word; + if (WIFCONTINUED(int_status_word)) RETURN_TRUE; #endif RETURN_FALSE; @@ -829,12 +837,14 @@ PHP_FUNCTION(pcntl_wexitstatus) { #ifdef WEXITSTATUS zend_long status_word; + int int_status_word; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) { return; } - RETURN_LONG(WEXITSTATUS((int)status_word)); + int_status_word = (int) status_word; + RETURN_LONG(WEXITSTATUS(int_status_word)); #else RETURN_FALSE; #endif @@ -847,12 +857,14 @@ PHP_FUNCTION(pcntl_wtermsig) { #ifdef WTERMSIG zend_long status_word; + int int_status_word; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) { return; } - RETURN_LONG(WTERMSIG((int)status_word)); + int_status_word = (int) status_word; + RETURN_LONG(WTERMSIG(int_status_word)); #else RETURN_FALSE; #endif @@ -865,12 +877,14 @@ PHP_FUNCTION(pcntl_wstopsig) { #ifdef WSTOPSIG zend_long status_word; + int int_status_word; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) { return; } - RETURN_LONG(WSTOPSIG((int)status_word)); + int_status_word = (int) status_word; + RETURN_LONG(WSTOPSIG(int_status_word)); #else RETURN_FALSE; #endif |