Re: proc_open() resources and their destruction
| From: | �ngel González | Date: | Thu, 12 Jul 2012 17:02:02 +0000 |
| Subject: | Re: proc_open() resources and their destruction | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-61174@lists.php.net to get a copy of this message | ||
On 12/07/12 17:30, Johannes Schlüter wrote:
> Hi,
>
> On Thu, 2012-07-12 at 17:09 +0200, Jille Timmermans wrote:
>> An implementation is quite simple:
>>
>> https://github.com/Jille/php-src/commit/31a1aa384c29487e077ccf3fd067eca188cf1201/§�¾a&„†
>> # ê$Ywî
> Without looking at the functional change itself a comment: The patch in
> this form can not be applied to 5.4 as php_file_globals is an exported
> public structure.
>
> If that branch is aimed for it might be acceptable to move
> int pclose_wait;
> to the end of the structure there. While even that isn't 100% nice.
>
> For 5.3 we certainly shouldn't do a functional change so late in the
> life cycle.
>
> johannes
The pclose_wait on php_file_globals isn't needed.
If only proc_close() is going to wait on the process, copy
proc->childHandle/proc->child,
before doing the zend_list_delete() in proc_close and move the waiting
code (lines 222-244)
of proc_open_rsrc_dtor below that call.
Not only you don't need to add a pclose_wait member, you now can get rid
of pclose_ret, too.