mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Capture Microsoft-defined HRESULT exit codes exit codes
The lack of such a check leads to false-passes of tests on Windows which expect no output, but produce a segfault or similar issue. I discovered this a while ago due to bad tests in an extension I maintain. Closes GH-6722.
This commit is contained in:
parent
8309c04464
commit
a480bf8093
1 changed files with 3 additions and 0 deletions
|
@ -1273,6 +1273,9 @@ function system_with_timeout($commandline, $env = null, $stdin = null, $captureS
|
|||
}
|
||||
if ($stat["exitcode"] > 128 && $stat["exitcode"] < 160) {
|
||||
$data .= "\nTermsig=" . ($stat["exitcode"] - 128) . "\n";
|
||||
} else if (defined('PHP_WINDOWS_VERSION_MAJOR') && (($stat["exitcode"] >> 28) & 0b1111) === 0b1100) {
|
||||
// https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/87fba13e-bf06-450e-83b1-9241dc81e781
|
||||
$data .= "\nTermsig=" . $stat["exitcode"] . "\n";
|
||||
}
|
||||
|
||||
proc_close($proc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue