From: James E. Flemer Date: Sat, 3 Aug 2002 14:54:30 +0000 (+0000) Subject: Close pipes to avoid deadlock. X-Git-Tag: dev~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9eb12132068fe1fbf95c903216413254062e898b;p=php Close pipes to avoid deadlock. Submitted By: Melvyn Sopacua --- diff --git a/ext/standard/tests/general_functions/proc_open.phpt b/ext/standard/tests/general_functions/proc_open.phpt index af275fe6bb..a094b5c600 100644 --- a/ext/standard/tests/general_functions/proc_open.phpt +++ b/ext/standard/tests/general_functions/proc_open.phpt @@ -20,6 +20,12 @@ $cat = proc_open( $pipes ); +/* As per manual: avoid deadlock */ +for ($i = 0; $i < count($pipes); $i++) +{ + fclose($pipes[$i]); +} + proc_close($cat); echo "I didn't segfault!\n";