1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-12 17:43:37 +02:00

Revised workaround for bug #1266

This commit is contained in:
Leland Lucius
2015-12-21 16:59:46 -06:00
parent d6297ed01d
commit ef527f83fc
2 changed files with 14 additions and 6 deletions

View File

@@ -1175,6 +1175,10 @@ wxRenameFile(const wxString& file1, const wxString& file2, bool overwrite)
#if !defined(__WXWINCE__)
// Normal system call
//
// For explanation, see: (warning...based mostly on observed behavior)
// http://bugzilla.audacityteam.org/show_bug.cgi?id=1266
// https://github.com/audacity/audacity/pull/94
unsigned long doserrno = 0;
for (int i = 0; i < 2000; i++)
{
@@ -1182,8 +1186,8 @@ wxRenameFile(const wxString& file1, const wxString& file2, bool overwrite)
return true;
unsigned long doserrno;
_get_doserrno(&doserrno);
if (doserrno != ERROR_ACCESS_DENIED && (doserrno == ERROR_ALREADY_EXISTS && exists))
break;
if (doserrno != ERROR_ACCESS_DENIED && (doserrno != ERROR_ALREADY_EXISTS || exists))
break;
wxMilliSleep(1);
}
#endif