update session manage

pull/234/head
taoxiangdong 4 years ago
parent 5c4b3b1b9e
commit 149aa07034

@ -154,7 +154,7 @@ int MemoryDumper::OpenFile(const char *filename) {
// Using the O_EXCL, if the file already exists,return failed to avoid privilege escalation vulnerability. // Using the O_EXCL, if the file already exists,return failed to avoid privilege escalation vulnerability.
mmMode_t mode = M_IRUSR | M_IWUSR; mmMode_t mode = M_IRUSR | M_IWUSR;
int32_t fd = mmOpen2(real_path.c_str(), M_WRONLY | M_CREAT | O_TRUNC, mode); int32_t fd = mmOpen2(real_path.c_str(), M_RDWR | M_CREAT | O_TRUNC, mode);
if (fd == EN_ERROR || fd == EN_INVALID_PARAM) { if (fd == EN_ERROR || fd == EN_INVALID_PARAM) {
GELOGE(kInvalidFd, "open file failed. errno = %d, %s", fd, strerror(errno)); GELOGE(kInvalidFd, "open file failed. errno = %d, %s", fd, strerror(errno));
return kInvalidFd; return kInvalidFd;

@ -173,7 +173,7 @@ Status SessionManager::AddGraph(SessionId session_id, uint32_t graph_id, const G
Status SessionManager::AddGraphWithCopy(SessionId session_id, uint32_t graph_id, const Graph &graph, Status SessionManager::AddGraphWithCopy(SessionId session_id, uint32_t graph_id, const Graph &graph,
const std::map<std::string, std::string> &options) { const std::map<std::string, std::string> &options) {
if (!init_flag_) { if (!init_flag_) {
GELOGE(GE_SESSION_MANAGER_NOT_INIT); GELOGE(GE_SESSION_MANAGER_NOT_INIT, "Session manager is not initialized.");
return GE_SESSION_MANAGER_NOT_INIT; return GE_SESSION_MANAGER_NOT_INIT;
} }
SessionPtr innerSession = nullptr; SessionPtr innerSession = nullptr;

Loading…
Cancel
Save