mirror of https://github.com/BOINC/boinc.git
- 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:
parent
1637c19e08
commit
5cb66db61d
|
@ -6610,3 +6610,10 @@ David 15 Sept 2010
|
||||||
boinc_api.cpp,h
|
boinc_api.cpp,h
|
||||||
graphics2_unix.cpp
|
graphics2_unix.cpp
|
||||||
graphics2_win.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
|
||||||
|
|
|
@ -568,8 +568,7 @@ int boinc_copy(const char* orig, const char* newf) {
|
||||||
|
|
||||||
static int boinc_rename_aux(const char* old, const char* newf) {
|
static int boinc_rename_aux(const char* old, const char* newf) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
boinc_delete_file(newf);
|
if (MoveFileEx(old, newf, MOVEFILE_REPLACE_EXISTING|MOVEFILE_WRITE_THROUGH)) return 0;
|
||||||
if (MoveFileA(old, newf)) return 0;
|
|
||||||
return GetLastError();
|
return GetLastError();
|
||||||
#else
|
#else
|
||||||
int retval = rename(old, newf);
|
int retval = rename(old, newf);
|
||||||
|
|
Loading…
Reference in New Issue