Fixed bug #23913 (make rename() work across partitions on *nix)

This commit is contained in:
Ilia Alshanetsky 2003-05-31 00:32:45 +00:00
parent 3240dce99c
commit 32a0044a21

View File

@ -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;
}