#37074 [Opn->Fbk]: pclose returns -1 (some times)
| From: | tony2001@php.net | Date: | Thu, 13 Apr 2006 19:30:18 +0000 |
| Subject: | #37074 [Opn->Fbk]: pclose returns -1 (some times) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-95770@lists.php.net to get a copy of this message | ||
ID: 37074
Updated by: tony2001@php.net
Reported By: mauroi at digbang dot com
-Status: Open
+Status: Feedback
Bug Type: Unknown/Other Function
Operating System: CentOS release 4.2
PHP Version: 5.1.2
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2006-04-13 19:28:29] mauroi at digbang dot com
Forgot to mention.
I doesn't happen in Windows.
------------------------------------------------------------------------
[2006-04-13 19:26:59] mauroi at digbang dot com
Description:
------------
With the following script (in CLI), sometimes I get -1 and sometimes 0.
The report it's very similar to #8992, but with proc_close.
With out withoud --enable-sigchild.
Thanks in advance.
Reproduce code:
---------------
<?
$cmd = "ls";
if ($process = popen($command, 'r'))
{
$output = stream_get_contents($process);
$returnCode = pclose($process);
}
echo $returnCode . "\n";
?>
Expected result:
----------------
0
Actual result:
--------------
-1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37074&edit=1