From 087401c29bc7c4087be41ca2c584fa4da78af2f0 Mon Sep 17 00:00:00 2001 From: jjfeing Date: Mon, 19 Oct 2020 16:22:51 +0800 Subject: [PATCH] fix dump create file error. --- mindspore/ccsrc/utils/system/file_system.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mindspore/ccsrc/utils/system/file_system.cc b/mindspore/ccsrc/utils/system/file_system.cc index 39933d5647..ccb2321f0b 100644 --- a/mindspore/ccsrc/utils/system/file_system.cc +++ b/mindspore/ccsrc/utils/system/file_system.cc @@ -15,6 +15,7 @@ */ #include "utils/system/file_system.h" + #include #include @@ -75,8 +76,10 @@ bool PosixFileSystem::CreateDir(const string &dir_name) { } auto result = mkdir(dir_name.c_str(), DEFAULT_MKDIR_MODE); if (result != 0) { - MS_LOG(ERROR) << "Create the dir(" << dir_name << ") is falire, error(" << errno << ")."; - return false; + if (errno != EEXIST) { + MS_LOG(ERROR) << "Create the dir(" << dir_name << ") is falire, error(" << errno << ")."; + return false; + } } return true; }