mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
apply better fix, so that the default handle would be closed when closing its reference
This commit is contained in:
parent
41bd0ca803
commit
5c46c52f09
1 changed files with 5 additions and 3 deletions
|
@ -278,13 +278,15 @@ PHP_FUNCTION(closedir)
|
||||||
{
|
{
|
||||||
zval **id, **tmp, *myself;
|
zval **id, **tmp, *myself;
|
||||||
php_stream *dirp;
|
php_stream *dirp;
|
||||||
|
int rsrc_id;
|
||||||
|
|
||||||
FETCH_DIRP();
|
FETCH_DIRP();
|
||||||
|
|
||||||
if (dirp->rsrc_id == DIRG(default_dir)) {
|
rsrc_id = dirp->rsrc_id;
|
||||||
|
zend_list_delete(dirp->rsrc_id);
|
||||||
|
|
||||||
|
if (rsrc_id == DIRG(default_dir)) {
|
||||||
php_set_default_dir(-1 TSRMLS_CC);
|
php_set_default_dir(-1 TSRMLS_CC);
|
||||||
} else {
|
|
||||||
zend_list_delete(dirp->rsrc_id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue