]> granicus.if.org Git - php/commitdiff
Fix #75873: pcntl_wexitstatus returns incorrect on Big_Endian platform (s390x)
authorSam Ding <samding@ca.ibm.com>
Fri, 23 Feb 2018 15:11:18 +0000 (10:11 -0500)
committerChristoph M. Becker <cmbecker69@gmx.de>
Fri, 23 Feb 2018 22:50:36 +0000 (23:50 +0100)
Cf. https://github.com/php/php-src/pull/3141.

NEWS
ext/pcntl/pcntl.c

diff --git a/NEWS b/NEWS
index 6c4e537239399dd69a347c80998608bfd7cc4027..7dcc0b8473ceaa97af7fa0162ef09a7130eb8116 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -36,6 +36,10 @@ PHP                                                                        NEWS
 - OpenSSL:
   . Fixed openssl_* arginfos. (carusogabriel)
 
+- PCNTL:
+  . Fixed bug #75873 (pcntl_wexitstatus returns incorrect on Big_Endian platform
+    (s390x)). (Sam Ding)
+
 - PGSQL:
   . Fixed #75838 (Memory leak in pg_escape_bytea()). (ard_1 at mail dot ru)
 
index ef05cc35a3cc7cbcd88d8bc894e40069a30a31ec..886099c5733f33639ab217a3d9c2eaa178d1e4e9 100644 (file)
@@ -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