- client (Win): use MoveFileEx() to rename file.

More atomic than delete/rename.
		fixes #1010

svn path=/trunk/boinc/; revision=22364
This commit is contained in:
David Anderson 2010-09-15 23:25:23 +00:00
parent 1637c19e08
commit 5cb66db61d
2 changed files with 8 additions and 2 deletions

View File

@ -6610,3 +6610,10 @@ David 15 Sept 2010
boinc_api.cpp,h
graphics2_unix.cpp
graphics2_win.cpp
David 15 Sept 2010
- client (Win): use MoveFileEx() to rename file.
More atomic than delete/rename.
fixes #1010
lib/
filesyst.cpp

View File

@ -568,8 +568,7 @@ int boinc_copy(const char* orig, const char* newf) {
static int boinc_rename_aux(const char* old, const char* newf) {
#ifdef _WIN32
boinc_delete_file(newf);
if (MoveFileA(old, newf)) return 0;
if (MoveFileEx(old, newf, MOVEFILE_REPLACE_EXISTING|MOVEFILE_WRITE_THROUGH)) return 0;
return GetLastError();
#else
int retval = rename(old, newf);