1 Star 0 Fork 10

jinlun/dim

forked from src-openEuler/dim 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Maximun-number-of-line-in-a-modification-policy.patch 1.89 KB
一键复制 编辑 原始数据 按行查看 历史
From f96c809dc83d8d0f44e586ccc4441e80dfe135f4 Mon Sep 17 00:00:00 2001
From: jinlun <jinlun@huawei.com>
Date: Mon, 17 Jun 2024 19:59:15 +0800
Subject: [PATCH 05/14] Maximun number of line in a modification policy
---
src/core/policy/dim_core_policy.h | 2 +-
src/core/policy/dim_core_policy_complex.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/core/policy/dim_core_policy.h b/src/core/policy/dim_core_policy.h
index 7f2c756..3b38d13 100644
--- a/src/core/policy/dim_core_policy.h
+++ b/src/core/policy/dim_core_policy.h
@@ -10,7 +10,7 @@
/* the policy filepath */
#define DIM_POLICY_PATH "/etc/dim/policy"
/* max number of lines for parsing */
-#define DIM_POLICY_LINE_MAX 10000
+#define DIM_POLICY_LINE_MAX 100000
/* measurement object of policy */
enum dim_policy_obj {
diff --git a/src/core/policy/dim_core_policy_complex.c b/src/core/policy/dim_core_policy_complex.c
index 8c02227..cba2dd7 100644
--- a/src/core/policy/dim_core_policy_complex.c
+++ b/src/core/policy/dim_core_policy_complex.c
@@ -165,7 +165,7 @@ static int policy_parse_line(char* line, int line_no, void *data)
ret = parse_line(line, policy);
if (ret < 0) {
policy_destroy(policy);
- dim_err("fail to parse policy at line %d: %d\n", line_no, ret);
+ dim_err("failed to parse policy at line %d: %d\n", line_no, ret);
return ret;
}
@@ -174,7 +174,7 @@ static int policy_parse_line(char* line, int line_no, void *data)
policy_destroy(policy);
/* ignore the repeat add */
if (ret != -EEXIST)
- dim_err("fail to add policy at line %d: %d\n", line_no, ret);
+ dim_err("failed to add policy at line %d: %d\n", line_no, ret);
return ret == -EEXIST ? 0 : ret;
}
@@ -188,4 +188,4 @@ int policy_parse_complex_format(char *buf, size_t buf_len,
return -EINVAL;
return dim_parse_line_buf(buf, buf_len, policy_parse_line, policy_add);
-}
\ No newline at end of file
+}
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jinlun123123/dim.git
git@gitee.com:jinlun123123/dim.git
jinlun123123
dim
dim
master

搜索帮助