From 6abda70550ba5b73a9c4fe653f954437a91c7e15 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Sun, 21 Apr 2019 14:02:14 +0200 Subject: [PATCH] recheck if mkdir fails --- 3rdParty/iresearch/core/utils/file_utils.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/3rdParty/iresearch/core/utils/file_utils.cpp b/3rdParty/iresearch/core/utils/file_utils.cpp index aa93d75d62..ba40bc6fe7 100644 --- a/3rdParty/iresearch/core/utils/file_utils.cpp +++ b/3rdParty/iresearch/core/utils/file_utils.cpp @@ -801,6 +801,10 @@ bool mkdir(const file_path_t path) NOEXCEPT { } #else if (0 != ::mkdir(path, S_IRWXU|S_IRWXG|S_IRWXO)) { + if (errno == EEXIST && exists_directory(result, path) && result) { + return true; + } + IR_FRMT_ERROR("Failed to create path: '%s', error %d", path, errno); return false; @@ -1145,4 +1149,4 @@ NS_END // ROOT // ----------------------------------------------------------------------------- // --SECTION-- END-OF-FILE -// ----------------------------------------------------------------------------- \ No newline at end of file +// -----------------------------------------------------------------------------