Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
f4e6b3ee
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看板
提交
f4e6b3ee
编写于
12月 25, 2021
作者:
X
xionglei6
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
init: fix codedex
Signed-off-by:
N
xionglei6
<
xionglei6@huawei.com
>
上级
b6ee22cc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
16 deletion
+13
-16
services/begetctl/main.c
services/begetctl/main.c
+2
-5
services/init/standard/init_reboot.c
services/init/standard/init_reboot.c
+3
-3
test/unittest/init/cmds_unittest.cpp
test/unittest/init/cmds_unittest.cpp
+1
-1
ueventd/ueventd.c
ueventd/ueventd.c
+7
-7
未找到文件。
services/begetctl/main.c
浏览文件 @
f4e6b3ee
...
...
@@ -28,13 +28,11 @@ static struct CMD_LIST_ST *m_cmdList = NULL;
int
BegetCtlCmdAdd
(
const
char
*
name
,
BegetCtlCmdPtr
cmd
)
{
struct
CMD_LIST_ST
*
item
;
if
(
name
==
NULL
)
{
return
-
1
;
}
item
=
(
struct
CMD_LIST_ST
*
)
malloc
(
sizeof
(
struct
CMD_LIST_ST
));
struct
CMD_LIST_ST
*
item
=
(
struct
CMD_LIST_ST
*
)
malloc
(
sizeof
(
struct
CMD_LIST_ST
));
if
(
item
==
NULL
)
{
return
-
1
;
}
...
...
@@ -83,7 +81,6 @@ static void BegetCtlUsage(const char *command)
int
main
(
int
argc
,
char
**
argv
)
{
const
struct
CMD_LIST_ST
*
cmd
;
const
char
*
last
=
strrchr
(
argv
[
0
],
'/'
);
// Get the first ending command name
...
...
@@ -101,7 +98,7 @@ int main(int argc, char **argv)
}
// Match the command
cmd
=
BegetCtlCmdFind
(
last
);
c
onst
struct
CMD_LIST_ST
*
c
md
=
BegetCtlCmdFind
(
last
);
if
(
cmd
==
NULL
)
{
BegetCtlUsage
(
last
);
return
0
;
...
...
services/init/standard/init_reboot.c
浏览文件 @
f4e6b3ee
...
...
@@ -48,16 +48,16 @@ static int RBMiscWriteUpdaterMessage(const char *path, const struct RBMiscUpdate
INIT_CHECK_RETURN_VALUE
(
realPath
!=
NULL
,
-
1
);
int
ret
=
0
;
FILE
*
fp
=
fopen
(
realPath
,
"rb+"
);
free
(
realPath
);
realPath
=
NULL
;
if
(
fp
!=
NULL
)
{
size_t
writeLen
=
fwrite
(
boot
,
sizeof
(
struct
RBMiscUpdateMessage
),
1
,
fp
);
INIT_ERROR_CHECK
(
writeLen
==
1
,
ret
=
-
1
,
"Failed to write misc for reboot"
);
(
void
)
fclose
(
fp
);
}
else
{
ret
=
-
1
;
INIT_LOGE
(
"Failed to open %s"
,
path
);
}
free
(
realPath
);
realPath
=
NULL
;
(
void
)
fclose
(
fp
);
return
ret
;
}
...
...
test/unittest/init/cmds_unittest.cpp
浏览文件 @
f4e6b3ee
...
...
@@ -103,7 +103,7 @@ HWTEST_F(CmdsUnitTest, TestCommonChmod, TestSize.Level1)
{
const
char
*
testFile
=
"/data/init_ut/test_dir0/test_file0"
;
const
mode_t
testMode
=
S_IRWXU
|
S_IRWXG
|
S_IRWXO
;
int
fd
=
open
(
testFile
,
O_CREAT
|
O_WRONLY
);
int
fd
=
open
(
testFile
,
O_CREAT
|
O_WRONLY
,
testMode
);
ASSERT_GE
(
fd
,
0
);
DoCmdByName
(
"chmod "
,
"777 /data/init_ut/test_dir0/test_file0"
);
struct
stat
info
;
...
...
ueventd/ueventd.c
浏览文件 @
f4e6b3ee
...
...
@@ -133,13 +133,13 @@ static void HandleUeventRequired(const struct Uevent *uevent, char **devices, in
if
(
uevent
->
partitionName
==
NULL
)
{
INIT_LOGI
(
"Match with %s for %s"
,
devices
[
i
],
uevent
->
syspath
);
deviceName
=
strstr
(
devices
[
i
],
"/dev/block"
);
if
(
deviceName
!=
NULL
)
{
deviceName
+=
sizeof
(
"/dev/block"
)
-
1
;
if
(
strstr
(
uevent
->
syspath
,
deviceName
)
!=
NULL
)
{
HandleBlockDeviceEvent
(
uevent
);
break
;
}
}
INIT_INFO_CHECK
(
deviceName
!=
NULL
,
continue
,
"device %s not match
\"
/dev/block
\"
."
,
devices
[
i
])
;
deviceName
+=
sizeof
(
"/dev/block"
)
-
1
;
INIT_INFO_CHECK
(
strstr
(
uevent
->
syspath
,
deviceName
)
!=
NULL
,
continue
,
"uevent->syspath %s not match deviceName %s"
,
uevent
->
syspath
,
deviceName
)
;
HandleBlockDeviceEvent
(
uevent
);
break
;
}
else
if
(
strstr
(
devices
[
i
],
uevent
->
partitionName
)
!=
NULL
)
{
INIT_LOGI
(
"Handle block device partitionName %s"
,
uevent
->
partitionName
);
HandleBlockDeviceEvent
(
uevent
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录