|
|
@@ -49,8 +49,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status MemoryDumper::DumpToFile |
|
|
|
// Open the file |
|
|
|
int fd = OpenFile(filename); |
|
|
|
if (fd == kInvalidFd) { |
|
|
|
GELOGE(FAILED, "[Open][File]Failed, filename:%s.", filename.c_str()); |
|
|
|
REPORT_INNER_ERROR("E19999", "Opne file failed, filename:%s.", filename.c_str()); |
|
|
|
GELOGE(FAILED, "[Open][File]Failed, filename:%s.", filename); |
|
|
|
REPORT_INNER_ERROR("E19999", "Opne file failed, filename:%s.", filename); |
|
|
|
return FAILED; |
|
|
|
} |
|
|
|
|
|
|
@@ -66,8 +66,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status MemoryDumper::DumpToFile |
|
|
|
|
|
|
|
// Close the file |
|
|
|
if (mmClose(fd) != EN_OK) { // mmClose return 0: success |
|
|
|
GELOGE(FAILED, "[Close][File]Failed, error_code:%u, filename:%s.", ret, file_name.c_str()); |
|
|
|
REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u, filename:%s.", ret, filename.c_str()); |
|
|
|
GELOGE(FAILED, "[Close][File]Failed, error_code:%u, filename:%s.", ret, file_name); |
|
|
|
REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u, filename:%s.", ret, filename); |
|
|
|
ret = FAILED; |
|
|
|
} |
|
|
|
|
|
|
@@ -164,7 +164,7 @@ int MemoryDumper::OpenFile(const char *filename) { |
|
|
|
int32_t fd = mmOpen2(real_path.c_str(), M_RDWR | M_CREAT | O_TRUNC, mode); |
|
|
|
if (fd == EN_ERROR || fd == EN_INVALID_PARAM) { |
|
|
|
GELOGE(kInvalidFd, "[Open][File]Failed. errno = %d, error:%s, filename:%s.", |
|
|
|
fd, strerror(errno), filename.c_str()); |
|
|
|
fd, strerror(errno), filename); |
|
|
|
return kInvalidFd; |
|
|
|
} |
|
|
|
return fd; |
|
|
|