Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
811fc153
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
1 年多 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
811fc153
编写于
12月 16, 2022
作者:
O
openharmony_ci
提交者:
Gitee
12月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1628 支持产品workspace size 定制
Merge pull request !1628 from cheng_jinsong/init-worksize
上级
e93900e6
3fbf3c64
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
3 deletion
+12
-3
services/param/adapter/param_selinux.c
services/param/adapter/param_selinux.c
+2
-1
services/param/base/param_trie.c
services/param/base/param_trie.c
+5
-1
services/param/manager/param_server.c
services/param/manager/param_server.c
+5
-1
未找到文件。
services/param/adapter/param_selinux.c
浏览文件 @
811fc153
...
...
@@ -136,8 +136,9 @@ static uint32_t GetWorkSpaceSize(const char *content)
return
PARAM_WORKSPACE_MAX
;
}
char
name
[
PARAM_NAME_LEN_MAX
]
=
{
0
};
int
index
=
6
;
// 6 strlen for const.
(
void
)
ParamMemcpy
(
name
,
sizeof
(
name
),
"const."
,
index
);
size_t
len
=
strlen
(
content
);
int
index
=
0
;
for
(
size_t
i
=
strlen
(
"u:object_r:"
);
i
<
len
;
i
++
)
{
if
(
*
(
content
+
i
)
==
':'
)
{
break
;
...
...
services/param/base/param_trie.c
浏览文件 @
811fc153
...
...
@@ -342,7 +342,11 @@ INIT_LOCAL_API ParamNode *GetParamNode(uint32_t index, const char *name)
INIT_LOCAL_API
int
AddParamEntry
(
uint32_t
index
,
uint8_t
type
,
const
char
*
name
,
const
char
*
value
)
{
WorkSpace
*
workSpace
=
GetWorkSpace
(
WORKSPACE_INDEX_BASE
);
ParamTrieNode
*
node
=
AddTrieNode
(
workSpace
,
name
,
strlen
(
name
));
ParamTrieNode
*
node
=
FindTrieNode
(
workSpace
,
name
,
strlen
(
name
),
NULL
);
if
(
node
!=
NULL
&&
node
->
dataIndex
!=
0
)
{
return
0
;
}
node
=
AddTrieNode
(
workSpace
,
name
,
strlen
(
name
));
PARAM_CHECK
(
node
!=
NULL
,
return
PARAM_CODE_REACHED_MAX
,
"Failed to add node"
);
ParamNode
*
entry
=
(
ParamNode
*
)
GetTrieNode
(
workSpace
,
node
->
dataIndex
);
if
(
entry
==
NULL
)
{
...
...
services/param/manager/param_server.c
浏览文件 @
811fc153
...
...
@@ -256,10 +256,14 @@ static int LoadOneParamAreaSize_(const uint32_t *context, const char *name, cons
ret
=
CheckParamValue
(
NULL
,
name
,
value
,
PARAM_TYPE_INT
);
PARAM_CHECK
(
ret
==
0
,
return
0
,
"Invalid value %s for %s"
,
value
,
name
);
PARAM_LOGV
(
"LoadOneParamAreaSize_ [%s] [%s]"
,
name
,
value
);
return
AddParamEntry
(
WORKSPACE_INDEX_BASE
,
PARAM_TYPE_INT
,
name
,
value
);
char
buffer
[
PARAM_NAME_LEN_MAX
]
=
{
0
};
int
len
=
sprintf_s
(
buffer
,
sizeof
(
buffer
),
"const.%s"
,
name
);
PARAM_CHECK
(
len
>
0
,
return
0
,
"Failed to format value %s for %s"
,
value
,
name
);
return
AddParamEntry
(
WORKSPACE_INDEX_BASE
,
PARAM_TYPE_INT
,
buffer
,
value
);
}
INIT_LOCAL_API
void
LoadParamAreaSize
(
void
)
{
LoadDefaultParam_
(
"/sys_prod/etc/param/ohos.para.size"
,
0
,
NULL
,
0
,
LoadOneParamAreaSize_
);
LoadDefaultParam_
(
PARAM_AREA_SIZE_CFG
,
0
,
NULL
,
0
,
LoadOneParamAreaSize_
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录