Skip to content

Commit 0b5c291

Browse files
Merge branch '5.4' into 6.3
* 5.4: [Process] Fix silencing `wait` when using a sigchild-enabled binary
2 parents d62c23a + 45261e1 commit 0b5c291

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Process.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public function start(callable $callback = null, array $env = [])
328328

329329
// See https://unix.stackexchange.com/questions/71205/background-process-pipe-input
330330
$commandline = '{ ('.$commandline.') <&3 3<&- 3>/dev/null & } 3<&0;';
331-
$commandline .= 'pid=$!; echo $pid >&3; wait $pid; code=$?; echo $code >&3; exit $code';
331+
$commandline .= 'pid=$!; echo $pid >&3; wait $pid 2>/dev/null; code=$?; echo $code >&3; exit $code';
332332

333333
// Workaround for the bug, when PTS functionality is enabled.
334334
// @see : https://bugs.php.net/69442

Tests/ProcessTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,7 @@ public function testWaitStoppedDeadProcess()
15221522
$process->wait();
15231523
$this->assertFalse($process->isRunning());
15241524

1525-
if ('\\' !== \DIRECTORY_SEPARATOR) {
1525+
if ('\\' !== \DIRECTORY_SEPARATOR && !\Closure::bind(fn () => $this->isSigchildEnabled(), $process, $process)()) {
15261526
$this->assertSame(0, $process->getExitCode());
15271527
}
15281528
}

0 commit comments

Comments
 (0)