!210 代码坏味道整改

Merge pull request !210 from xushengbin/master
This commit is contained in:
openharmony_ci
2025-07-31 10:09:47 +00:00
committed by Gitee
3 changed files with 6 additions and 6 deletions
@@ -386,7 +386,7 @@ int IntelliSenseServer::CreateNewRtgGrp(int prioType, int rtNum)
char fileName[] = "/proc/self/sched_rtg_ctrl";
FILE* f = fopen(fileName, "r+");
if (f == nullptr) {
RME_LOGE("Open file /proc/self/sched_rth_ctrl, errno = %{public}d", errno);
RME_LOGE("[CreateNewRtgGrp]:fopen file failed, errno = %{public}d", errno);
return -1;
}
int fd = fileno(f);
@@ -409,7 +409,7 @@ int IntelliSenseServer::CreateNewRtgGrp(int prioType, int rtNum)
}
int fc = fclose(f);
if (fc != 0) {
RME_LOGE("fclose file /proc/self/sched_rth_ctrl, errno = %{public}d (%{public}s)", errno, strerror(errno));
RME_LOGE("[CreateNewRtgGrp]:fclose file failed, errno = %{public}d (%{public}s)", errno, strerror(errno));
}
return ret;
}
@@ -33,7 +33,6 @@ std::vector<int> ParaConfig::m_renderTypeList;
bool ParaConfig::IsXmlPrepared(const std::string& filePath)
{
xmlDocPtr docPtr = xmlReadFile(filePath.c_str(), nullptr, XML_PARSE_NOBLANKS);
RME_LOGI("[IsXmlPrepared]:filePath:%{public}s", filePath.c_str());
if (docPtr == nullptr) {
RME_LOGE("[IsXmlPrepared]:load xml error!");
return false;
@@ -68,11 +68,12 @@ __attribute__((constructor)) void BasicOpenRtgNode()
char fileName[] = "/proc/self/sched_rtg_ctrl";
g_f = fopen(fileName, "r+");
if (g_f == nullptr) {
RME_LOGI("rtg Open fail, errno = %{public}d(%{public}s), dev = %{public}s", errno, strerror(errno), fileName);
RME_LOGI("rtg fOpen fail, errno = %{public}d(%{public}s)", errno, strerror(errno));
return;
}
g_fd = fileno(g_f);
if (g_fd < 0) {
RME_LOGI("rtg fileno fail, errno = %{public}d(%{public}s)", errno, strerror(errno));
return;
}
RME_LOGI("rtg Open success");
@@ -87,7 +88,7 @@ __attribute__((destructor)) void BasicCloseRtgNode()
RME_LOGI("rtg Close g_fd ret is %{public}d", g_fd);
int fc = fclose(g_f);
if (fc != 0) {
RME_LOGE("rtg fclose file /proc/self/sched_rtg_ctrl, errno = %{public}d (%{public}s)", errno, strerror(errno));
RME_LOGE("rtg fclose file, errno = %{public}d (%{public}s)", errno, strerror(errno));
}
g_fd = -1;
g_f = nullptr;
@@ -308,7 +309,7 @@ int EndScene(int grpId)
{
int ret = 0;
if (g_fd < 0) {
RME_LOGE("Open fail /proc/self/sched_rtg_ctrl");
RME_LOGE("[EndScene]:Open file failed");
return g_fd;
}
struct proc_state_data state_data;