mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
don't remove correct file when failing to rename the incorrect one
This commit is contained in:
parent
69985789f1
commit
e640f676e0
@ -274,7 +274,7 @@ store(BamCacheRecord *record) {
|
|||||||
temp_file.close();
|
temp_file.close();
|
||||||
|
|
||||||
// Now move the file into place.
|
// Now move the file into place.
|
||||||
if (!temp_pathname.rename_to(cache_pathname)) {
|
if (!temp_pathname.rename_to(cache_pathname) && temp_pathname.exists()) {
|
||||||
cache_pathname.unlink();
|
cache_pathname.unlink();
|
||||||
if (!temp_pathname.rename_to(cache_pathname)) {
|
if (!temp_pathname.rename_to(cache_pathname)) {
|
||||||
util_cat.error()
|
util_cat.error()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user