Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
cc611bb9
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,发现更多精彩内容 >>
提交
cc611bb9
编写于
10月 24, 2022
作者:
C
chengjinsong
提交者:
cheng_jinsong
10月 27, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed
74b47348
from
https://gitee.com/chneg-jinsong/startup_init_lite/pulls/1424
codex Signed-off-by:
N
chengjinsong
<
chengjinsong2@huawei.com
>
上级
f9a21d26
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
1 deletion
+5
-1
services/modules/reboot/reboot_static.c
services/modules/reboot/reboot_static.c
+3
-0
test/moduletest/param_test_cmds.c
test/moduletest/param_test_cmds.c
+1
-0
test/unittest/init/loopevent_unittest.cpp
test/unittest/init/loopevent_unittest.cpp
+1
-1
未找到文件。
services/modules/reboot/reboot_static.c
浏览文件 @
cc611bb9
...
...
@@ -24,6 +24,7 @@
#define REBOOT_NAME_PREFIX "reboot,"
#define REBOOT_CMD_PREFIX "reboot."
#define REBOOT_REPLACE_PREFIX "reboot."
#define PARAM_CMD_MAX 100
static
int
RebootHookWrapper
(
const
HOOK_INFO
*
hookInfo
,
void
*
executionContext
)
{
...
...
@@ -111,6 +112,7 @@ static int SetParamCmdInfo(ParamCmdInfo *currInfo, CmdExecutor executor, const c
static
int
AddRebootCmdExecutor_
(
const
char
*
cmd
,
CmdExecutor
executor
)
{
PLUGIN_CHECK
(
g_rebootParamCmdMaxNumber
<=
PARAM_CMD_MAX
,
return
-
1
,
"Param cmd max number exceed limit"
);
if
(
g_rebootParamCmdMaxNumber
==
0
||
g_rebootParamCmdMaxNumber
<=
g_rebootParamCmdValidNumber
)
{
g_rebootParamCmdMaxNumber
+=
5
;
// inc 5 once time
ParamCmdInfo
*
cmdInfos
=
calloc
(
1
,
sizeof
(
ParamCmdInfo
)
*
g_rebootParamCmdMaxNumber
);
...
...
@@ -126,6 +128,7 @@ static int AddRebootCmdExecutor_(const char *cmd, CmdExecutor executor)
}
g_rebootParamCmdInfos
=
cmdInfos
;
}
PLUGIN_CHECK
(
g_rebootParamCmdValidNumber
<
g_rebootParamCmdMaxNumber
,
return
-
1
,
"Param cmd number exceed limit"
);
return
SetParamCmdInfo
(
&
g_rebootParamCmdInfos
[
g_rebootParamCmdValidNumber
],
executor
,
cmd
);
}
...
...
test/moduletest/param_test_cmds.c
浏览文件 @
cc611bb9
...
...
@@ -295,6 +295,7 @@ static int32_t BShellParamCmdMemGet(BShellHandle shell, int32_t argc, char *argv
PLUGIN_CHECK
(
argc
>
1
,
return
-
1
,
"Invalid parameter"
);
uint32_t
buffSize
=
0
;
// 1024 max buffer for decode
char
*
buff
=
GetLocalBuffer
(
&
buffSize
);
PLUGIN_CHECK
(
buff
!=
NULL
,
return
-
1
,
"Failed to get local buffer"
);
int
ret
=
sprintf_s
(
buff
,
buffSize
-
1
,
"/proc/%s/smaps"
,
argv
[
1
]);
PLUGIN_CHECK
(
ret
>
0
,
return
-
1
,
"Failed to format path %s"
,
argv
[
1
]);
buff
[
ret
]
=
'\0'
;
...
...
test/unittest/init/loopevent_unittest.cpp
浏览文件 @
cc611bb9
...
...
@@ -201,8 +201,8 @@ public:
if
(
task
!=
nullptr
)
{
task
->
handleEvent
=
TestHandleTaskEvent
;
ProcessEvent
((
EventLoop
*
)
LE_GetDefaultLoop
(),
testfd
,
Event_Read
);
((
HashTab
*
)(((
EventLoop
*
)
LE_GetDefaultLoop
())
->
taskMap
))
->
nodeFree
(
&
task
->
hashNode
);
}
((
HashTab
*
)(((
EventLoop
*
)
LE_GetDefaultLoop
())
->
taskMap
))
->
nodeFree
(
&
task
->
hashNode
);
}
void
ProcessasynEvent
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录