From 0324ebbd638844762bbefb6ac1c227f70ab6bd7f Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 14 Feb 2015 12:52:57 +0100 Subject: [PATCH] Fixed: Unable to patch when Ryzom was located on a mounted FS --- code/ryzom/client/src/login_patch.cpp | 10 +++++----- code/ryzom/client/src/login_patch.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 5b9a83c83..e98cd1e32 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -1068,12 +1068,12 @@ float CPatchManager::getCurrentFileProgress() const } // **************************************************************************** -void CPatchManager::setRWAccess (const string &filename) +void CPatchManager::setRWAccess (const string &filename, bool bThrowException) { ucstring s = CI18N::get("uiSetAttrib") + " " + filename; setState(true, s); - if (!NLMISC::CFile::setRWAccess(filename)) + if (!NLMISC::CFile::setRWAccess(filename) && bThrowException) { s = CI18N::get("uiAttribErr") + " " + filename + " (" + toString(errno) + "," + strerror(errno) + ")"; setState(true, s); @@ -1351,7 +1351,7 @@ void CPatchManager::downloadFileWithCurl (const string &source, const string &de // create the local file if (NLMISC::CFile::fileExists(dest)) { - setRWAccess(dest); + setRWAccess(dest, false); NLMISC::CFile::deleteFile(dest.c_str()); } FILE *fp = fopen (dest.c_str(), "wb"); @@ -1492,7 +1492,7 @@ void CPatchManager::decompressFile (const string &filename) } string dest = filename.substr(0, filename.size ()-4); - setRWAccess(dest); + setRWAccess(dest, false); //if(isVerboseLog()) nlinfo("Calling fopen('%s','wb')", dest.c_str()); FILE *fp = fopen (dest.c_str(), "wb"); if (fp == NULL) @@ -1566,7 +1566,7 @@ void CPatchManager::applyDate (const string &sFilename, uint32 nDate) { // _utimbuf utb; // utb.actime = utb.modtime = nDate; - setRWAccess(sFilename); + setRWAccess(sFilename, false); ucstring s = CI18N::get("uiChangeDate") + " " + NLMISC::CFile::getFilename(sFilename) + " " + toString(NLMISC::CFile::getFileModificationDate (sFilename)) + " -> " + toString(nDate); setState(true,s); diff --git a/code/ryzom/client/src/login_patch.h b/code/ryzom/client/src/login_patch.h index de7351775..565de7da2 100644 --- a/code/ryzom/client/src/login_patch.h +++ b/code/ryzom/client/src/login_patch.h @@ -302,7 +302,7 @@ private: /// Read the description of the highest client version file found void readClientVersionAndDescFile(); - void setRWAccess (const std::string &filename); + void setRWAccess (const std::string &filename, bool bThrowException=true); std::string deleteFile (const std::string &filename, bool bThrowException=true, bool bWarning=true);