summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar archshift2014-10-09 23:27:47 -0700
committerGravatar archshift2014-10-22 15:24:25 -0700
commita7c7946867c0f36c5091c1cf89954ccce637d51a (patch)
treee20649ce57257bc5224ff7cba1b87396b99ef5be /src
parentUse config files to store whether SDMC is enabled or not (diff)
downloadyuzu-a7c7946867c0f36c5091c1cf89954ccce637d51a.tar.gz
yuzu-a7c7946867c0f36c5091c1cf89954ccce637d51a.tar.xz
yuzu-a7c7946867c0f36c5091c1cf89954ccce637d51a.zip
Common: Return from CreateFullPath early if the directory creation fails
Diffstat (limited to '')
-rw-r--r--src/common/file_util.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index 78a642599..9e40e87d4 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -190,8 +190,10 @@ bool CreateFullPath(const std::string &fullPath)
190 190
191 // Include the '/' so the first call is CreateDir("/") rather than CreateDir("") 191 // Include the '/' so the first call is CreateDir("/") rather than CreateDir("")
192 std::string const subPath(fullPath.substr(0, position + 1)); 192 std::string const subPath(fullPath.substr(0, position + 1));
193 if (!FileUtil::IsDirectory(subPath)) 193 if (!FileUtil::IsDirectory(subPath) && !FileUtil::CreateDir(subPath)) {
194 FileUtil::CreateDir(subPath); 194 ERROR_LOG(COMMON, "CreateFullPath: directory creation failed");
195 return false;
196 }
195 197
196 // A safety check 198 // A safety check
197 panicCounter--; 199 panicCounter--;