Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
fdb3703b
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
接近 2 年 前同步成功
通知
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看板
提交
fdb3703b
编写于
5月 19, 2022
作者:
M
Mupceet
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: codex
Signed-off-by:
N
Mupceet
<
laiguizhong@huawei.com
>
上级
6e018620
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
28 addition
and
17 deletion
+28
-17
interfaces/innerkits/modulemgr/modulemgr.c
interfaces/innerkits/modulemgr/modulemgr.c
+14
-4
interfaces/innerkits/syspara/parameter.c
interfaces/innerkits/syspara/parameter.c
+2
-2
services/init/init_common_cmds.c
services/init/init_common_cmds.c
+6
-5
services/init/module_engine/init_modulemgr.c
services/init/module_engine/init_modulemgr.c
+1
-1
services/init/standard/init.c
services/init/standard/init.c
+1
-1
services/param/adapter/param_dac.c
services/param/adapter/param_dac.c
+2
-2
services/param/linux/param_osadp.c
services/param/linux/param_osadp.c
+1
-1
services/param/manager/param_trie.c
services/param/manager/param_trie.c
+1
-1
未找到文件。
interfaces/innerkits/modulemgr/modulemgr.c
浏览文件 @
fdb3703b
...
...
@@ -117,9 +117,15 @@ static void *moduleInstall(MODULE_ITEM *module, int argc, const char *argv[])
module
->
moduleMgr
->
installArgs
.
argv
=
argv
;
if
(
module
->
moduleMgr
->
name
[
0
]
==
'/'
)
{
snprintf_s
(
path
,
sizeof
(
path
),
sizeof
(
path
)
-
1
,
"%s/%s"
MODULE_SUFFIX_D
,
module
->
moduleMgr
->
name
,
module
->
name
);
if
(
snprintf_s
(
path
,
sizeof
(
path
),
sizeof
(
path
)
-
1
,
"%s/%s"
MODULE_SUFFIX_D
,
module
->
moduleMgr
->
name
,
module
->
name
)
<
0
)
{
return
NULL
;
}
}
else
{
snprintf_s
(
path
,
sizeof
(
path
),
sizeof
(
path
)
-
1
,
"/system/"
MODULE_LIB_NAME
"/%s/%s"
MODULE_SUFFIX_D
,
module
->
moduleMgr
->
name
,
module
->
name
);
if
(
snprintf_s
(
path
,
sizeof
(
path
),
sizeof
(
path
)
-
1
,
"/system/"
MODULE_LIB_NAME
"/%s/%s"
MODULE_SUFFIX_D
,
module
->
moduleMgr
->
name
,
module
->
name
)
<
0
)
{
return
NULL
;
}
}
currentInstallArgs
=
&
(
module
->
moduleMgr
->
installArgs
);
...
...
@@ -239,9 +245,13 @@ MODULE_MGR *ModuleMgrScan(const char *modulePath)
}
if
(
modulePath
[
0
]
==
'/'
)
{
snprintf_s
(
path
,
sizeof
(
path
),
sizeof
(
path
)
-
1
,
"%s"
,
modulePath
);
if
(
snprintf_s
(
path
,
sizeof
(
path
),
sizeof
(
path
)
-
1
,
"%s"
,
modulePath
)
<
0
)
{
return
NULL
;
}
}
else
{
snprintf_s
(
path
,
sizeof
(
path
),
sizeof
(
path
)
-
1
,
"/system/"
MODULE_LIB_NAME
"/%s"
,
modulePath
);
if
(
snprintf_s
(
path
,
sizeof
(
path
),
sizeof
(
path
)
-
1
,
"/system/"
MODULE_LIB_NAME
"/%s"
,
modulePath
)
<
0
)
{
return
NULL
;
};
}
scanModules
(
moduleMgr
,
path
);
...
...
interfaces/innerkits/syspara/parameter.c
浏览文件 @
fdb3703b
...
...
@@ -249,7 +249,7 @@ static const char *GetOSName(void)
static
const
char
*
BuildOSFullName
(
void
)
{
const
char
release
[]
=
"Release"
;
char
value
[
OS_FULL_NAME_LEN
];
char
value
[
OS_FULL_NAME_LEN
]
=
{
0
}
;
const
char
*
releaseType
=
GetOsReleaseType
();
int
length
;
if
((
releaseType
==
NULL
)
||
(
strncmp
(
releaseType
,
release
,
sizeof
(
release
)
-
1
)
==
0
))
{
...
...
@@ -291,7 +291,7 @@ static int GetSdkApiLevel(void)
static
const
char
*
BuildVersionId
(
void
)
{
char
value
[
VERSION_ID_MAX_LEN
];
char
value
[
VERSION_ID_MAX_LEN
]
=
{
0
}
;
int
len
=
sprintf_s
(
value
,
VERSION_ID_MAX_LEN
,
"%s/%s/%s/%s/%s/%s/%s/%d/%s/%s"
,
GetDeviceType
(),
GetManufacture
(),
GetBrand
(),
GetProductSeries
(),
...
...
services/init/init_common_cmds.c
浏览文件 @
fdb3703b
...
...
@@ -463,16 +463,17 @@ static void DoMount(const struct CmdArgs *ctx)
}
}
static
int
DoWriteWithMultiArgs
(
const
struct
CmdArgs
*
ctx
,
int
fd
)
{
static
int
DoWriteWithMultiArgs
(
const
struct
CmdArgs
*
ctx
,
int
fd
)
{
char
buf
[
MAX_CMD_CONTENT_LEN
];
/* Write to proc files should be done at once */
buf
[
0
]
=
'\0'
;
strcat_s
(
buf
,
sizeof
(
buf
),
ctx
->
argv
[
1
]
);
INIT_ERROR_CHECK
(
strcat_s
(
buf
,
sizeof
(
buf
),
ctx
->
argv
[
1
])
==
0
,
return
-
1
,
"Failed to format buf"
);
int
idx
=
2
;
while
(
idx
<
ctx
->
argc
)
{
strcat_s
(
buf
,
sizeof
(
buf
),
"
"
);
strcat_s
(
buf
,
sizeof
(
buf
),
ctx
->
argv
[
idx
]
);
INIT_ERROR_CHECK
(
strcat_s
(
buf
,
sizeof
(
buf
),
" "
)
==
0
,
return
-
1
,
"Failed to format buf
"
);
INIT_ERROR_CHECK
(
strcat_s
(
buf
,
sizeof
(
buf
),
ctx
->
argv
[
idx
])
==
0
,
return
-
1
,
"Failed to format buf"
);
idx
++
;
}
return
write
(
fd
,
buf
,
strlen
(
buf
));
...
...
@@ -493,7 +494,7 @@ static void DoWrite(const struct CmdArgs *ctx)
if
(
fd
<
0
)
{
return
;
}
size_t
ret
;
s
s
ize_t
ret
;
if
(
ctx
->
argc
>
2
)
{
ret
=
DoWriteWithMultiArgs
(
ctx
,
fd
);
}
else
{
...
...
services/init/module_engine/init_modulemgr.c
浏览文件 @
fdb3703b
...
...
@@ -67,7 +67,7 @@ static int moduleMgrCommandsInit(int stage, int prio, void *cookie)
static
int
loadAutorunModules
(
int
stage
,
int
prio
,
void
*
cookie
)
{
MODULE_MGR
*
autorun
=
ModuleMgrScan
(
"init/autorun"
);
INIT_LOG
I
(
"Load autorun modules return %p"
,
autorun
);
INIT_LOG
V
(
"Load autorun modules return %p"
,
autorun
);
return
0
;
}
...
...
services/init/standard/init.c
浏览文件 @
fdb3703b
...
...
@@ -324,7 +324,7 @@ static void InitPostHook(const HOOK_INFO *hookInfo)
diff
-=
(
stat
->
endTime
.
tv_nsec
-
stat
->
startTime
.
tv_nsec
)
*
1000
;
}
INIT_LOG
I
(
"Executing hook [%d:%d:%p] cost [%lld]ms, return %d."
,
INIT_LOG
V
(
"Executing hook [%d:%d:%p] cost [%lld]ms, return %d."
,
hookInfo
->
stage
,
hookInfo
->
prio
,
hookInfo
->
hook
,
diff
,
hookInfo
->
retVal
);
}
...
...
services/param/adapter/param_dac.c
浏览文件 @
fdb3703b
...
...
@@ -234,11 +234,11 @@ int RegisterSecurityDacOps(ParamSecurityOps *ops, int isInit)
return
ret
;
}
static
void
AddGroupUser
(
int
uid
,
int
gid
,
int
mode
,
const
char
*
format
)
static
void
AddGroupUser
(
unsigned
int
uid
,
unsigned
int
gid
,
int
mode
,
const
char
*
format
)
{
ParamAuditData
auditData
=
{
0
};
char
buffer
[
USER_BUFFER_LEN
]
=
{
0
};
int
ret
=
sprintf_s
(
buffer
,
sizeof
(
buffer
)
-
1
,
"%s.%
d.%d
"
,
format
,
gid
,
uid
);
int
ret
=
sprintf_s
(
buffer
,
sizeof
(
buffer
)
-
1
,
"%s.%
u.%u
"
,
format
,
gid
,
uid
);
PARAM_CHECK
(
ret
>=
0
,
return
,
"Failed to format name for %s.%d.%d"
,
format
,
gid
,
uid
);
auditData
.
name
=
buffer
;
auditData
.
dacData
.
uid
=
uid
;
...
...
services/param/linux/param_osadp.c
浏览文件 @
fdb3703b
...
...
@@ -75,7 +75,7 @@ void *GetSharedMem(const char *fileName, MemHandle *handle, uint32_t spaceSize,
}
void
*
areaAddr
=
(
void
*
)
mmap
(
NULL
,
spaceSize
,
prot
,
MAP_SHARED
,
fd
,
0
);
PARAM_CHECK
(
areaAddr
!=
MAP_FAILED
&&
areaAddr
!=
NULL
,
close
(
fd
);
return
NULL
,
"Failed to map memory error %d
areaAddr %p spaceSize %d"
,
errno
,
areaAddr
,
spaceSize
);
return
NULL
,
"Failed to map memory error %d
spaceSize %d"
,
errno
,
spaceSize
);
close
(
fd
);
return
areaAddr
;
}
...
...
services/param/manager/param_trie.c
浏览文件 @
fdb3703b
...
...
@@ -45,7 +45,7 @@ static int InitWorkSpace_(WorkSpace *workSpace, uint32_t spaceSize, int readOnly
PARAM_CHECK
(
ret
==
0
,
return
-
1
,
"Failed to get file name %s"
,
workSpace
->
fileName
);
void
*
areaAddr
=
GetSharedMem
(
buffer
,
&
workSpace
->
memHandle
,
spaceSize
,
readOnly
);
PARAM_CHECK
(
areaAddr
!=
NULL
,
return
PARAM_CODE_ERROR_MAP_FILE
,
"Failed to map memory error %d
areaAddr %p spaceSize %d"
,
errno
,
areaAddr
,
spaceSize
);
"Failed to map memory error %d
spaceSize %d"
,
errno
,
spaceSize
);
if
(
!
readOnly
)
{
workSpace
->
area
=
(
ParamTrieHeader
*
)
areaAddr
;
workSpace
->
area
->
trieNodeCount
=
0
;
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
9d0fde8c
·
5月 22, 2022
mentioned in commit
9d0fde8c
mentioned in commit 9d0fde8cc6de5ae0c3b80d80231dc5f3e2e892b6
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录