From dae56b8dcb5ec0467be45402f08078af19447ec3 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 13 Sep 2021 10:45:34 -0500 Subject: [PATCH] Update for base branch Signed-off-by: Michael Carroll --- src/TempDirectory.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/TempDirectory.cc b/src/TempDirectory.cc index 9197605f..9cf6e9ad 100644 --- a/src/TempDirectory.cc +++ b/src/TempDirectory.cc @@ -78,7 +78,7 @@ std::string createTempDirectory( fs::path templatePath = _baseName + "XXXXXX"; std::string fullTemplateStr = (parentPath / templatePath).string(); - if (!createDirectories(parentPath.string())) + if (!createDirectories(parentPath.string())) { std::error_code ec{errno, std::system_category()}; errno = 0; @@ -87,14 +87,14 @@ std::string createTempDirectory( #ifdef _WIN32 errno_t errcode = _mktemp_s(&fullTemplateStr[0], fullTemplateStr.size() + 1); - if (errcode) + if (errcode) { std::error_code ec(static_cast(errcode), std::system_category()); throw std::system_error(ec, "could not format the temp directory name template"); } const fs::path finalPath{fullTemplateStr}; - if (!createDirectories(finalPath.string())) + if (!createDirectories(finalPath.string())) { std::error_code ec(static_cast(GetLastError()), std::system_category()); @@ -102,7 +102,8 @@ std::string createTempDirectory( } #else const char * dirName = mkdtemp(&fullTemplateStr[0]); - if (dirName == nullptr) { + if (dirName == nullptr) + { std::error_code ec{errno, std::system_category()}; errno = 0; throw std::system_error(ec, @@ -121,7 +122,8 @@ std::string ignition::common::createTempDirectory( const FilesystemWarningOp _warningOp) { std::string ret; - try { + try + { ret = ::createTempDirectory(_baseName, _parentPath); } catch (const std::system_error &ex)