mirror of
https://github.com/php/php-src.git
synced 2024-11-25 02:44:58 +08:00
MFB don't close random fds
This commit is contained in:
parent
56ba9b4ae5
commit
af402a9e13
@ -1565,7 +1565,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
|
||||
zend_file_handle *prepend_file_p, *append_file_p;
|
||||
zend_file_handle prepend_file, append_file;
|
||||
#if HAVE_BROKEN_GETCWD
|
||||
int old_cwd_fd;
|
||||
int old_cwd_fd = -1;
|
||||
#else
|
||||
char *old_cwd;
|
||||
#endif
|
||||
@ -1649,8 +1649,10 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
|
||||
} zend_end_try();
|
||||
|
||||
#if HAVE_BROKEN_GETCWD
|
||||
fchdir(old_cwd_fd);
|
||||
close(old_cwd_fd);
|
||||
if (old_cwd_fd != -1) {
|
||||
fchdir(old_cwd_fd);
|
||||
close(old_cwd_fd);
|
||||
}
|
||||
#else
|
||||
if (old_cwd[0] != '\0') {
|
||||
VCWD_CHDIR(old_cwd);
|
||||
|
Loading…
Reference in New Issue
Block a user