diff --git a/include/ALL.hpp b/include/ALL.hpp index 52efc823e26b696b52e9d846c4050e2d3a5ccce9..f0c685ecc23c53da38e19791f3df8bd30bb07d67 100644 --- a/include/ALL.hpp +++ b/include/ALL.hpp @@ -822,10 +822,11 @@ private: errno = 0; mode_t mode = S_IRWXU | S_IRWXG; // rwx for user and group if(mkdir(filename, mode)) { - if(errno == EEXIST) return; - throw FilesystemErrorException( - __FILE__, __func__, __LINE__, - "Could not create output directory."); + if(errno != EEXIST) { + throw FilesystemErrorException( + __FILE__, __func__, __LINE__, + "Could not create output directory."); + } } // check permission in case directory already existed, but had wrong // permissions