Re: proc_open() resources and their destruction
| From: | Jille Timmermans | Date: | Fri, 13 Jul 2012 10:01:38 +0000 |
| Subject: | Re: proc_open() resources and their destruction | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-61192@lists.php.net to get a copy of this message | ||
Op 12-07-12 19:02, Ángel González schreef:
On 12/07/12 17:30, Johannes Schlüter wrote:What is the policy in this situation? Angels proposed changes are cleaner but they deprecate the pclose_ret field which could be used by third-party extensions. Do we want to commit the same code to 5.4 and 5.5+? Otherwise we could use my patch for 5.4 and Angels proposal for 5.5+? -- JilleHi, On Thu, 2012-07-12 at 17:09 +0200, Jille Timmermans wrote: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. Agreed.An implementation is quite simple: https://github.com/Jille/php-src/commit/31a1aa384c29487e077ccf3fd067eca188cf1201Without 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