Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1fcbc53

Browse files
committed
Fix wrong loop in Process::wait() method
The while condition was the oposite of the previous while. This was obviously leading to the death of this loop. Loop which was usefull according to some people (see #28940), so I just moved the code to the right position.
1 parent c2e55ff commit 1fcbc53

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Symfony/Component/Process/Process.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,8 @@ public function wait(callable $callback = null)
416416
$this->checkTimeout();
417417
$running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen();
418418
$this->readPipes($running, '\\' !== \DIRECTORY_SEPARATOR || !$running);
419-
} while ($running);
420-
421-
while ($this->isRunning()) {
422419
usleep(1000);
423-
}
420+
} while ($running);
424421

425422
if ($this->processInformation['signaled'] && $this->processInformation['termsig'] !== $this->latestSignal) {
426423
throw new ProcessSignaledException($this);

0 commit comments

Comments
 (0)