summaryrefslogtreecommitdiffstats
path: root/src/common/file_util.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2014-10-24 00:51:54 +0200
committerbunnei <bunneidev@gmail.com>2014-10-24 00:51:54 +0200
commitce8390ac03661ec2b16e48aeaca02ae8c9291ec5 (patch)
tree0d4a4391fda3c58522b6d6ef056b78f67d2b0592 /src/common/file_util.cpp
parentMerge pull request #146 from yuriks/inttypes (diff)
parentCommon: Return from CreateFullPath early if the directory creation fails (diff)
downloadyuzu-ce8390ac03661ec2b16e48aeaca02ae8c9291ec5.tar
yuzu-ce8390ac03661ec2b16e48aeaca02ae8c9291ec5.tar.gz
yuzu-ce8390ac03661ec2b16e48aeaca02ae8c9291ec5.tar.bz2
yuzu-ce8390ac03661ec2b16e48aeaca02ae8c9291ec5.tar.lz
yuzu-ce8390ac03661ec2b16e48aeaca02ae8c9291ec5.tar.xz
yuzu-ce8390ac03661ec2b16e48aeaca02ae8c9291ec5.tar.zst
yuzu-ce8390ac03661ec2b16e48aeaca02ae8c9291ec5.zip
Diffstat (limited to 'src/common/file_util.cpp')
-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 77a226885..35da07306 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -191,8 +191,10 @@ bool CreateFullPath(const std::string &fullPath)
// Include the '/' so the first call is CreateDir("/") rather than CreateDir("")
std::string const subPath(fullPath.substr(0, position + 1));
- if (!FileUtil::IsDirectory(subPath))
- FileUtil::CreateDir(subPath);
+ if (!FileUtil::IsDirectory(subPath) && !FileUtil::CreateDir(subPath)) {
+ ERROR_LOG(COMMON, "CreateFullPath: directory creation failed");
+ return false;
+ }
// A safety check
panicCounter--;