[vlc-commits] Update windows rename function to correctly deal with pre-existing files.

Rob Jonson git at videolan.org
Thu Apr 28 19:35:35 CEST 2011


vlc | branch: master | Rob Jonson <rob at hobbyistsoftware.com> | Thu Apr 28 16:27:54 2011 +0100| [812905a60444be7091d08e749d3c486c02bb481b] | committer: Rémi Denis-Courmont

Update windows rename function to correctly deal with pre-existing files.

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=812905a60444be7091d08e749d3c486c02bb481b
---

 src/win32/filesystem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/win32/filesystem.c b/src/win32/filesystem.c
index 6d16ad3..dfcaee8 100644
--- a/src/win32/filesystem.c
+++ b/src/win32/filesystem.c
@@ -230,7 +230,7 @@ int vlc_rename (const char *oldpath, const char *newpath)
     /* FIXME: errno support */
     return MoveFileW (wold, wnew) ? 0 : -1;
 #else
-    if (_wrename (wold, wnew) && errno == EACCES)
+    if (_wrename (wold, wnew) && (errno == EACCES || errno == EEXIST))
     {   /* Windows does not allow atomic file replacement */
         if (_wremove (wnew))
         {



More information about the vlc-commits mailing list