代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/rasdaemon 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From: Xiaofei Tan <tanxiaofei@huawei.com>
Date: Sat, 20 Aug 2022 09:49:25 +0000
Subject: [PATCH] rasdaemon: use standard length PATH_MAX for path name
Use standard length PATH_MAX for path name space allocation
to replace the macro MAX_PATH_LEN.
Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
---
ras-cpu-isolation.c | 6 +++---
ras-cpu-isolation.h | 1 -
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/ras-cpu-isolation.c b/ras-cpu-isolation.c
index ba5ccd1..24c07e9 100644
--- a/ras-cpu-isolation.c
+++ b/ras-cpu-isolation.c
@@ -80,11 +80,11 @@ static const char * const cpu_state[] = {
static int open_sys_file(unsigned int cpu, int __oflag, const char *format)
{
int fd;
- char path[MAX_PATH_LEN + 1] = "";
- char real_path[MAX_PATH_LEN + 1] = "";
+ char path[PATH_MAX] = "";
+ char real_path[PATH_MAX] = "";
snprintf(path, sizeof(path), format, cpu);
- if (strlen(path) > MAX_PATH_LEN || realpath(path, real_path) == NULL) {
+ if (strlen(path) > PATH_MAX || realpath(path, real_path) == NULL) {
log(TERM, LOG_ERR, "[%s]:open file: %s failed\n", __func__, path);
return -1;
}
diff --git a/ras-cpu-isolation.h b/ras-cpu-isolation.h
index 024a68b..5682106 100644
--- a/ras-cpu-isolation.h
+++ b/ras-cpu-isolation.h
@@ -17,7 +17,6 @@
#include "queue.h"
-#define MAX_PATH_LEN 100
#define MAX_BUF_LEN 1024
struct param {
--
2.17.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。