From f15b0b125562ef0c00981c83841b65a150abf007 Mon Sep 17 00:00:00 2001 From: Shengting Cui Date: Wed, 24 Jul 2024 20:53:31 +0000 Subject: [PATCH] Incorporate reviewer's suggestions --- include/realizations/catchment/Formulation_Manager.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/realizations/catchment/Formulation_Manager.hpp b/include/realizations/catchment/Formulation_Manager.hpp index 58614bb12f..f587e1fe36 100644 --- a/include/realizations/catchment/Formulation_Manager.hpp +++ b/include/realizations/catchment/Formulation_Manager.hpp @@ -304,13 +304,13 @@ namespace realization { //use C++ system function to check if there is a dir match that defined in realization struct stat sb; - if (stat(dir, &sb) == 0 && S_ISDIR(sb.st_mode)) - return dir; - else { + if (stat(dir, &sb) == 0 && S_ISDIR(sb.st_mode)) { + return str; + } else { errno = 0; int result = mkdir(dir, 0755); if (result == 0) - return dir; + return str; else throw std::runtime_error("failed to create directory '" + str + "': " + std::strerror(errno)); }