Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
2bc2af1a
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
2bc2af1a
编写于
3月 09, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 09, 2023
浏览文件
操作
浏览文件
下载
差异文件
!1814 增强/proc/cmdline转换为param的兼容性
Merge pull request !1814 from handy/0308
上级
c1307802
cf9a3a6e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
8 deletion
+21
-8
services/param/manager/param_server.c
services/param/manager/param_server.c
+21
-8
未找到文件。
services/param/manager/param_server.c
浏览文件 @
2bc2af1a
...
...
@@ -103,7 +103,9 @@ static int SnDealFun(const char *name, const char *value)
static
void
CmdlineIterator
(
const
NAME_VALUE_PAIR
*
nv
,
void
*
context
)
{
int
ret
;
const
char
*
name
;
const
char
*
matched
;
char
fullName
[
PARAM_NAME_LEN_MAX
];
cmdLineIteratorCtx
*
ctx
=
(
cmdLineIteratorCtx
*
)
context
;
char
*
data
=
(
char
*
)
ctx
->
cmdline
;
...
...
@@ -118,7 +120,7 @@ static void CmdlineIterator(const NAME_VALUE_PAIR *nv, void *context)
data
[
nv
->
name_end
-
data
]
=
'\0'
;
data
[
nv
->
value_end
-
data
]
=
'\0'
;
PARAM_LOG
E
(
"proc cmdline: name [%s], value [%s]"
,
nv
->
name
,
nv
->
value
);
PARAM_LOG
V
(
"proc cmdline: name [%s], value [%s]"
,
nv
->
name
,
nv
->
value
);
// Get name without prefix
name
=
nv
->
name
;
...
...
@@ -128,15 +130,26 @@ static void CmdlineIterator(const NAME_VALUE_PAIR *nv, void *context)
// Matching reserved cmdlines
for
(
size_t
i
=
0
;
i
<
ARRAY_LENGTH
(
cmdLines
);
i
++
)
{
if
(
strcmp
(
name
,
cmdLines
[
i
].
name
)
==
0
)
{
snprintf_s
(
fullName
,
sizeof
(
fullName
),
sizeof
(
fullName
)
-
1
,
OHOS_CMDLINE_PARA_PREFIX
"%s"
,
cmdLines
[
i
].
name
);
PARAM_LOGE
(
"proc cmdline %s matched."
,
fullName
);
int
ret
=
cmdLines
[
i
].
processor
(
fullName
,
nv
->
value
);
if
((
ret
==
0
)
&&
(
SnDealFun
==
cmdLines
[
i
].
processor
))
{
ctx
->
gotSn
=
true
;
// Check exact match
if
(
strcmp
(
name
,
cmdLines
[
i
].
name
)
!=
0
)
{
// Check if contains ".xxx" for compatibility
ret
=
snprintf_s
(
fullName
,
sizeof
(
fullName
),
sizeof
(
fullName
)
-
1
,
".%s"
,
cmdLines
[
i
].
name
);
matched
=
strstr
(
name
,
fullName
);
if
(
matched
==
NULL
)
{
continue
;
}
return
;
// Check if it is ended with pattern
if
(
matched
[
ret
]
!=
'\0'
)
{
continue
;
}
}
snprintf_s
(
fullName
,
sizeof
(
fullName
),
sizeof
(
fullName
)
-
1
,
OHOS_CMDLINE_PARA_PREFIX
"%s"
,
cmdLines
[
i
].
name
);
PARAM_LOGV
(
"proc cmdline %s matched."
,
fullName
);
ret
=
cmdLines
[
i
].
processor
(
fullName
,
nv
->
value
);
if
((
ret
==
0
)
&&
(
SnDealFun
==
cmdLines
[
i
].
processor
))
{
ctx
->
gotSn
=
true
;
}
return
;
}
if
(
name
==
nv
->
name
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录