Skip to content
  • Sponsor symfony/symfony

  • Notifications You must be signed in to change notification settings
  • Fork 9.7k
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Symfony/Component/Process/Process.php
Original file line number Diff line number Diff line change
@@ -77,7 +77,6 @@ class Process implements \IteratorAggregate
private bool $pty;
private array $options = ['suppress_errors' => true, 'bypass_shell' => true];

private bool $useFileHandles;
private WindowsPipes|UnixPipes $processPipes;

private ?int $latestSignal = null;
@@ -163,7 +162,6 @@ public function __construct(array $command, string $cwd = null, array $env = nul

$this->setInput($input);
$this->setTimeout($timeout);
$this->useFileHandles = '\\' === \DIRECTORY_SEPARATOR;
$this->pty = false;
}

@@ -325,7 +323,7 @@ public function start(callable $callback = null, array $env = [])

if ('\\' === \DIRECTORY_SEPARATOR) {
$commandline = $this->prepareWindowsCommandLine($commandline, $env);
} elseif (!$this->useFileHandles && $this->isSigchildEnabled()) {
} elseif ($this->isSigchildEnabled()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} elseif ($this->isSigchildEnabled()) {
} elseif ('\\' !== \DIRECTORY_SEPARATOR && $this->isSigchildEnabled()) {

Copy link
Contributor

@chapterjason chapterjason Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The elseif will only be considered if if ('\\' === \DIRECTORY_SEPARATOR) (2 lines before) doesn't hit. Basically it will be checked twice but vice versa, as suggested change. 🤔

// last exit code is output on the fourth pipe and caught to work around --enable-sigchild
$descriptors[3] = ['pipe', 'w'];