summaryrefslogtreecommitdiff
path: root/ext/pcntl
diff options
context:
space:
mode:
authorSam Ding <samding@ca.ibm.com>2018-02-23 10:11:18 -0500
committerChristoph M. Becker <cmbecker69@gmx.de>2018-02-23 23:50:36 +0100
commit78c1ef2adbd3f9383659326cc85e7f45fef639ae (patch)
tree6b84f49020609c7d3e9e4460c1bbb30d504d62fd /ext/pcntl
parent0b8cfa6c786536947cfa0be1aad0e396096aded7 (diff)
downloadphp-git-78c1ef2adbd3f9383659326cc85e7f45fef639ae.tar.gz
Fix #75873: pcntl_wexitstatus returns incorrect on Big_Endian platform (s390x)
Cf. https://github.com/php/php-src/pull/3141.
Diffstat (limited to 'ext/pcntl')
-rw-r--r--ext/pcntl/pcntl.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index ef05cc35a3..886099c573 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -761,9 +761,10 @@ PHP_FUNCTION(pcntl_wifexited)
return;
}
- if (WIFEXITED(status_word))
+ if (WIFEXITED((int)status_word))
RETURN_TRUE;
#endif
+
RETURN_FALSE;
}
/* }}} */
@@ -779,7 +780,7 @@ PHP_FUNCTION(pcntl_wifstopped)
return;
}
- if (WIFSTOPPED(status_word))
+ if (WIFSTOPPED((int)status_word))
RETURN_TRUE;
#endif
RETURN_FALSE;
@@ -797,7 +798,7 @@ PHP_FUNCTION(pcntl_wifsignaled)
return;
}
- if (WIFSIGNALED(status_word))
+ if (WIFSIGNALED((int)status_word))
RETURN_TRUE;
#endif
RETURN_FALSE;
@@ -814,7 +815,7 @@ PHP_FUNCTION(pcntl_wifcontinued)
return;
}
- if (WIFCONTINUED(status_word))
+ if (WIFCONTINUED((int)status_word))
RETURN_TRUE;
#endif
RETURN_FALSE;
@@ -833,7 +834,7 @@ PHP_FUNCTION(pcntl_wexitstatus)
return;
}
- RETURN_LONG(WEXITSTATUS(status_word));
+ RETURN_LONG(WEXITSTATUS((int)status_word));
#else
RETURN_FALSE;
#endif
@@ -851,7 +852,7 @@ PHP_FUNCTION(pcntl_wtermsig)
return;
}
- RETURN_LONG(WTERMSIG(status_word));
+ RETURN_LONG(WTERMSIG((int)status_word));
#else
RETURN_FALSE;
#endif
@@ -869,7 +870,7 @@ PHP_FUNCTION(pcntl_wstopsig)
return;
}
- RETURN_LONG(WSTOPSIG(status_word));
+ RETURN_LONG(WSTOPSIG((int)status_word));
#else
RETURN_FALSE;
#endif