8000 bug #16510 [2.3][Process] fix Proccess run with pts enabled (ewgRa) · symfony/symfony@ab3c8f8 · GitHub
[go: up one dir, main page]

Skip to content

Commit ab3c8f8

Browse files
bug #16510 [2.3][Process] fix Proccess run with pts enabled (ewgRa)
This PR was squashed before being merged into the 2.3 branch (closes #16510). Discussion ---------- [2.3][Process] fix Proccess run with pts enabled | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #12643 | License | MIT | Doc PR | Commits ------- 9cf90fb [2.3][Process] fix Proccess run with pts enabled
2 parents f107a0a + 9cf90fb commit ab3c8f8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Symfony/Component/Process/Process.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,20 @@ public function start($callback = null)
237237
}
238238
}
239239

240+
$ptsWorkaround = null;
241+
242+
if (!$this->useFileHandles && $this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) {
243+
// Workaround for the bug, when PTS functionality is enabled.
244+
// @see : https://bugs.php.net/69442
245+
$ptsWorkaround = fopen('php://fd/0', 'r');
246+
}
247+
240248
$this->process = proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $this->env, $this->options);
241249

250+
if ($ptsWorkaround) {
251+
fclose($ptsWorkaround);
252+
}
253+
242254
if (!is_resource($this->process)) {
243255
throw new RuntimeException('Unable to launch a new process.');
244256
}

0 commit comments

Comments
 (0)
0