From cce80f25533fe5ceeb144cb9de0fcf57096b69b6 Mon Sep 17 00:00:00 2001 From: Dronplane Date: Mon, 27 May 2019 18:08:47 +0300 Subject: [PATCH] Bug fix/internal issue #572 (#9110) * Added helper method to DataStore in iresearch link for performing full data store reset. Fixed usage of data store reset. * Fixed checking directory creation status on windows --- 3rdParty/iresearch/core/utils/file_utils.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/3rdParty/iresearch/core/utils/file_utils.cpp b/3rdParty/iresearch/core/utils/file_utils.cpp index a7ba4753f7..75a7ebbba1 100644 --- a/3rdParty/iresearch/core/utils/file_utils.cpp +++ b/3rdParty/iresearch/core/utils/file_utils.cpp @@ -754,10 +754,17 @@ bool mkdir(const file_path_t path) NOEXCEPT { std::basic_string::type> parent(parts.dirname); if (!mkdir(parent.c_str())) { +#ifdef _WIN32 + if (::GetLastError() != ERROR_ALREADY_EXISTS) { + // failed to create parent + return false; + } +#else if (errno != EEXIST) { // failed to create parent return false; } +#endif } }