IssueNo:#I41FEV

Description:add judge whether it is negative
Sig:startup
Feature or Bugfix:Bugfix
Binary Source:No

Signed-off-by: wangdengjia <wangdengjia@huawei.com>
This commit is contained in:
wangdengjia
2021-07-19 20:39:30 +08:00
parent fb1bd08fbc
commit b57e96e34c
@@ -68,6 +68,10 @@ bool ExtractorUtil::ExtractFileToPath(const std::string &filePath, const std::st
fileStream.close();
int fd = open(filePath.c_str(), O_RDWR, S_IRUSR | S_IWUSR);
if (fd < 0) {
HILOG_ERROR(HILOG_MODULE_APP, "ExtractFileToPath open fail");
return false;
}
fsync(fd);
close(fd);
return true;