From dd0138198ff453d3f58ff1196623de3cdd1f8358 Mon Sep 17 00:00:00 2001 From: Frederick Roy Date: Wed, 4 Feb 2026 09:08:08 +0900 Subject: [PATCH] fix missing return warning --- .../Helper/src/sofa/helper/system/FileSystem.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Sofa/framework/Helper/src/sofa/helper/system/FileSystem.cpp b/Sofa/framework/Helper/src/sofa/helper/system/FileSystem.cpp index 20ce0b291b9..1e37b428ae5 100644 --- a/Sofa/framework/Helper/src/sofa/helper/system/FileSystem.cpp +++ b/Sofa/framework/Helper/src/sofa/helper/system/FileSystem.cpp @@ -170,21 +170,28 @@ bool FileSystem::createDirectory(const std::string& path) struct stat st_buf; if (stat(path.c_str(), &st_buf) == 0) { - if ((st_buf.st_mode & S_IFMT) != S_IFDIR) { - msg_error(error) << path << ": File exists and is not a directoy"; + if ((st_buf.st_mode & S_IFMT) != S_IFDIR) + { + msg_error(error) << path << ": File exists and is not a directory"; return true; } else { + // 'path' was already created and is a folder return false; } } - + else + { + msg_error(error) << path << ": Unknown error while trying to create this directory."; + return true; + } } } #endif else { + // 'path' has been created sucessfully return false; } }