Commit 812905a6 authored by ConfusedVorlon's avatar ConfusedVorlon Committed by Rémi Denis-Courmont
Browse files

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


Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent 900ad522
......@@ -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))
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment