!504 CDE告警处理

Merge pull request !504 from 包泽伟/master
This commit is contained in:
openharmony_ci 2024-11-15 08:49:10 +00:00 committed by Gitee
commit 6c5d24fb1c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -100,13 +100,17 @@ uint32_t PrintTask::Start(napi_env env, napi_callback_info info)
if (pathType_ == FILE_PATH_ABSOLUTED) {
for (auto file : fileList_) {
int32_t fd = PrintUtils::OpenFile(file);
if (fd < 0) {
PRINT_HILOGE("file[%{private}s] is invalid", file.c_str());
fdList_.clear();
fileList_.clear();
return E_PRINT_INVALID_PARAMETER;
if (fd >= 0) {
fdList_.emplace_back(fd);
continue;
}
fdList_.emplace_back(fd);
PRINT_HILOGE("file[%{private}s] is invalid", file.c_str());
for (auto fd : fdList_) {
close(fd);
}
fdList_.clear();
fileList_.clear();
return E_PRINT_INVALID_PARAMETER;
}
}