summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2008-05-02 14:08:44 +0000
committerDerick Rethans <derick@php.net>2008-05-02 14:08:44 +0000
commitd5a323788aee0e9513184fe68e50d277055e28c8 (patch)
treee6519fedd374bc2e30c804c03a33e2bd4bcebf89
parent8ea8cd611af5d11ff065838d2d221584941b35d0 (diff)
downloadphp-git-d5a323788aee0e9513184fe68e50d277055e28c8.tar.gz
- MF53: fix for bug #44870: rename() on directory deletes same named file.
(Patch by Pierre)
-rw-r--r--TSRM/tsrm_virtual_cwd.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/TSRM/tsrm_virtual_cwd.h b/TSRM/tsrm_virtual_cwd.h
index b9ecdf537a..d94f3adf69 100644
--- a/TSRM/tsrm_virtual_cwd.h
+++ b/TSRM/tsrm_virtual_cwd.h
@@ -299,7 +299,7 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC);
#if defined(TSRM_WIN32)
# define VCWD_RENAME(oldname, newname) MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING)
#else
-# define VCWD_RENAME(oldname, newname) rename(oldname, newname)
+# define VCWD_RENAME(oldname, newname) (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING) == 0 ? -1 : 0)
#endif
#define VCWD_CHDIR(path) chdir(path)
#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, chdir)