mirror of
https://github.com/php/php-src.git
synced 2024-11-25 19:05:31 +08:00
Fixed bug #23913 (make rename() work across partitions on *nix)
This commit is contained in:
parent
3240dce99c
commit
32a0044a21
@ -1391,6 +1391,14 @@ PHP_FUNCTION(rename)
|
||||
ret = VCWD_RENAME(old_name, new_name);
|
||||
|
||||
if (ret == -1) {
|
||||
#ifdef EXDEV
|
||||
if (errno == EXDEV) {
|
||||
if (php_copy_file(old_name, new_name TSRMLS_CC) == SUCCESS) {
|
||||
VCWD_UNLINK(old_name);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
php_error_docref2(NULL TSRMLS_CC, old_name, new_name, E_WARNING, "%s", strerror(errno));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user