aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/common/file_util.cpp
diff options
context:
space:
mode:
authorGravatar archshift <admin@archshift.com>2014-10-09 23:27:47 -0700
committerGravatar archshift <admin@archshift.com>2014-10-22 15:24:25 -0700
commita7c7946867c0f36c5091c1cf89954ccce637d51a (patch)
treee20649ce57257bc5224ff7cba1b87396b99ef5be /src/common/file_util.cpp
parenta59f57d50467bd5dba1f28b8020278d6298babf7 (diff)
Common: Return from CreateFullPath early if the directory creation fails
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 78a64259..9e40e87d 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -190,8 +190,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--;