From bf4a9b083c0df4d797a0fd5489b9cf8cb9901baf Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Sun, 7 Apr 2013 14:38:17 +0200 Subject: [PATCH] Round stream_select fifth argument up. - This argument must be an integer - An argument equal to 0 should be avoided as it consumes too much CPU time --- src/Symfony/Component/Process/Process.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index a4ee6a760a..56ff6d1ecc 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -290,7 +290,7 @@ class Process $w = $writePipes; $e = null; - $n = @stream_select($r, $w, $e, 0, static::TIMEOUT_PRECISION * 1E6); + $n = @stream_select($r, $w, $e, 0, ceil(static::TIMEOUT_PRECISION * 1E6)); if (false === $n) { break; @@ -360,7 +360,7 @@ class Process $e = null; // let's have a look if something changed in streams - if (false === $n = @stream_select($r, $w, $e, 0, static::TIMEOUT_PRECISION * 1E6)) { + if (false === $n = @stream_select($r, $w, $e, 0, ceil(static::TIMEOUT_PRECISION * 1E6))) { $lastError = error_get_last(); // stream_select returns false when the `select` system call is interrupted by an incoming signal