Skip to content

Commit

Permalink
Incorporate reviewer's suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
stcui007 authored and PhilMiller committed Jul 30, 2024
1 parent 653a2de commit f15b0b1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/realizations/catchment/Formulation_Manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit f15b0b1

Please sign in to comment.