Browse Source

!7454 fix create file error when e2e dump

Merge pull request !7454 from jjfeing/master
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
701ac565ae
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      mindspore/ccsrc/utils/system/file_system.cc

+ 5
- 2
mindspore/ccsrc/utils/system/file_system.cc View File

@@ -15,6 +15,7 @@
*/

#include "utils/system/file_system.h"

#include <sys/stat.h>
#include <unistd.h>

@@ -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;
}


Loading…
Cancel
Save