Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
75aa87f1
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看板
提交
75aa87f1
编写于
8月 12, 2022
作者:
C
chengjinsong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
codex
Signed-off-by:
N
chengjinsong
<
chengjinsong2@huawei.com
>
上级
ef252f39
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
13 addition
and
13 deletion
+13
-13
interfaces/innerkits/fs_manager/fstab.c
interfaces/innerkits/fs_manager/fstab.c
+1
-1
services/begetctl/dump_service.c
services/begetctl/dump_service.c
+1
-1
services/modules/bootevent/bootevent.c
services/modules/bootevent/bootevent.c
+5
-5
services/modules/init_hook/init_hook.c
services/modules/init_hook/init_hook.c
+3
-3
services/modules/init_hook/init_hook.h
services/modules/init_hook/init_hook.h
+2
-2
services/param/manager/param_manager.c
services/param/manager/param_manager.c
+1
-1
未找到文件。
interfaces/innerkits/fs_manager/fstab.c
浏览文件 @
75aa87f1
...
...
@@ -292,7 +292,7 @@ FstabItem *FindFstabItemForPath(Fstab fstab, const char *path)
return
item
;
}
static
char
*
GetFstabFile
(
char
*
fileName
,
in
t
size
)
static
char
*
GetFstabFile
(
char
*
fileName
,
size_
t
size
)
{
if
(
InUpdaterMode
()
==
1
)
{
if
(
strncpy_s
(
fileName
,
size
,
"/etc/fstab.updater"
,
strlen
(
"/etc/fstab.updater"
))
!=
0
)
{
...
...
services/begetctl/dump_service.c
浏览文件 @
75aa87f1
...
...
@@ -31,7 +31,7 @@ static int main_cmd(BShellHandle shell, int argc, char **argv)
CmdClientInit
(
INIT_CONTROL_FD_SOCKET_PATH
,
ACTION_DUMP
,
argv
[
1
]);
}
else
if
(
argc
==
DUMP_SERVICE_BOOTEVENT_CMD_ARGS
)
{
printf
(
"dump service bootevent info
\n
"
);
in
t
serviceNameLen
=
strlen
(
argv
[
1
])
+
strlen
(
argv
[
2
])
+
2
;
// 2 is \0 and #
size_
t
serviceNameLen
=
strlen
(
argv
[
1
])
+
strlen
(
argv
[
2
])
+
2
;
// 2 is \0 and #
char
*
serviceBootevent
=
(
char
*
)
calloc
(
1
,
serviceNameLen
);
BEGET_ERROR_CHECK
(
sprintf_s
(
serviceBootevent
,
serviceNameLen
,
"%s#%s"
,
argv
[
1
],
argv
[
2
])
>=
0
,
return
0
,
"dumpservice arg create failed"
);
...
...
services/modules/bootevent/bootevent.c
浏览文件 @
75aa87f1
...
...
@@ -26,7 +26,7 @@
#define BOOT_EVENT_PARA_PREFIX "bootevent."
#define BOOT_EVENT_PARA_PREFIX_LEN 10
#define BOOT_EVENT_TIMESTAMP_MAX_LEN 50
static
int
bootEventNum
=
0
;
static
int
g_
bootEventNum
=
0
;
enum
{
BOOTEVENT_FORK
,
...
...
@@ -116,9 +116,9 @@ static void BootEventParaFireByName(const char *paramName)
}
INIT_CHECK_ONLY_RETURN
(
clock_gettime
(
CLOCK_MONOTONIC
,
&
(((
BOOT_EVENT_PARAM_ITEM
*
)
found
)
->
timestamp
[
BOOTEVENT_READY
]))
==
0
);
bootEventNum
--
;
g_
bootEventNum
--
;
// Check if all boot event params are fired
if
(
bootEventNum
>
0
)
{
if
(
g_
bootEventNum
>
0
)
{
return
;
}
// All parameters are fired, set boot completed now ...
...
...
@@ -144,7 +144,7 @@ static void ServiceParseBootEventHook(SERVICE_PARSE_CTX *serviceParseCtx)
INIT_LOGI
(
"Add service bootevent failed %s"
,
serviceParseCtx
->
serviceName
);
return
;
}
bootEventNum
++
;
g_
bootEventNum
++
;
return
;
}
...
...
@@ -157,7 +157,7 @@ static void ServiceParseBootEventHook(SERVICE_PARSE_CTX *serviceParseCtx)
INIT_LOGI
(
"Add service bootevent failed %s"
,
serviceParseCtx
->
serviceName
);
continue
;
}
bootEventNum
++
;
g_
bootEventNum
++
;
}
}
...
...
services/modules/init_hook/init_hook.c
浏览文件 @
75aa87f1
...
...
@@ -102,11 +102,11 @@ int InitAddClearServiceHook(ServiceHook hook)
return
HookMgrAddEx
(
GetBootStageHookMgr
(),
&
info
);
}
static
int
CmdClear
_
(
int
id
,
const
char
*
name
,
int
argc
,
const
char
**
argv
)
static
int
CmdClear
(
int
id
,
const
char
*
name
,
int
argc
,
const
char
**
argv
)
{
SERVICE_INFO_CTX
ctx
=
{
0
};
ctx
.
reserved
=
argc
>=
1
?
argv
[
0
]
:
NULL
;
PLUGIN_LOGI
(
"CmdClear
_
%s cmd: %s"
,
name
,
ctx
.
reserved
);
PLUGIN_LOGI
(
"CmdClear %s cmd: %s"
,
name
,
ctx
.
reserved
);
InitGroupNode
*
node
=
GetNextGroupNode
(
NODE_TYPE_SERVICES
,
NULL
);
while
(
node
!=
NULL
)
{
...
...
@@ -123,7 +123,7 @@ static int CmdClear_(int id, const char *name, int argc, const char **argv)
static
int
ParamSetBootEventHook
(
const
HOOK_INFO
*
hookInfo
,
void
*
cookie
)
{
AddCmdExecutor
(
"clear"
,
CmdClear
_
);
AddCmdExecutor
(
"clear"
,
CmdClear
);
return
0
;
}
...
...
services/modules/init_hook/init_hook.h
浏览文件 @
75aa87f1
...
...
@@ -13,8 +13,8 @@
* limitations under the License.
*/
#ifndef STARTUP_INIT_PARAM_HOOK
_
#define STARTUP_INIT_PARAM_HOOK
_
#ifndef STARTUP_INIT_PARAM_HOOK
#define STARTUP_INIT_PARAM_HOOK
#include <stdio.h>
#include <stdint.h>
...
...
services/param/manager/param_manager.c
浏览文件 @
75aa87f1
...
...
@@ -242,7 +242,7 @@ INIT_INNER_API int GetParamSecurityAuditData(const char *name, int type, ParamAu
}
static
int
CreateCtrlInfo
(
ServiceCtrlInfo
**
ctrlInfo
,
const
char
*
cmd
,
uint32_t
offset
,
uint8_t
ctrlParam
,
const
char
*
format
,
...)
uint8_t
ctrlParam
,
const
char
*
format
,
...)
{
*
ctrlInfo
=
calloc
(
1
,
sizeof
(
ServiceCtrlInfo
));
PARAM_CHECK
(
ctrlInfo
!=
NULL
,
return
-
1
,
"Failed to alloc memory %s"
,
cmd
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录