Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
ebfe310e
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,发现更多精彩内容 >>
提交
ebfe310e
编写于
9月 28, 2021
作者:
S
sun_fan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
init: fix codedex
Signed-off-by:
N
sun_fan
<
sun_fan1@hoperun.com
>
上级
1cca6020
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
12 addition
and
9 deletion
+12
-9
interfaces/innerkits/dynamic_service/dynamic_service.c
interfaces/innerkits/dynamic_service/dynamic_service.c
+2
-2
interfaces/innerkits/reboot/init_reboot.c
interfaces/innerkits/reboot/init_reboot.c
+1
-1
services/cmds/reboot/init_cmd_reboot.c
services/cmds/reboot/init_cmd_reboot.c
+3
-1
services/cmds/service_control/service_control.c
services/cmds/service_control/service_control.c
+3
-1
services/log/init_log.c
services/log/init_log.c
+1
-1
services/src/init_cmds.c
services/src/init_cmds.c
+2
-3
未找到文件。
interfaces/innerkits/dynamic_service/dynamic_service.c
浏览文件 @
ebfe310e
...
...
@@ -31,7 +31,7 @@ int32_t StartDynamicProcess(const char *name)
return
-
1
;
}
if
(
SetParameter
(
"ohos.ctl.start"
,
name
)
!=
0
)
{
HILOG_ERROR
(
LOG_CORE
,
"Set param for
%{public}
s failed.
\n
"
,
name
);
HILOG_ERROR
(
LOG_CORE
,
"Set param for
{public}%
s failed.
\n
"
,
name
);
return
-
1
;
}
return
0
;
...
...
@@ -44,7 +44,7 @@ int32_t StopDynamicProcess(const char *name)
return
-
1
;
}
if
(
SetParameter
(
"ohos.ctl.stop"
,
name
)
!=
0
)
{
HILOG_ERROR
(
LOG_CORE
,
"Set param for
%{public}
s failed.
\n
"
,
name
);
HILOG_ERROR
(
LOG_CORE
,
"Set param for
{public}%
s failed.
\n
"
,
name
);
return
-
1
;
}
return
0
;
...
...
interfaces/innerkits/reboot/init_reboot.c
浏览文件 @
ebfe310e
...
...
@@ -45,7 +45,7 @@ int DoReboot(const char *option)
}
return
0
;
}
in
t
length
=
strlen
(
option
);
size_
t
length
=
strlen
(
option
);
if
(
length
>
MAX_REBOOT_OPTION_SIZE
)
{
INIT_LOGE
(
"Reboot option
\"
%s
\"
is too large, overflow"
,
option
);
return
-
1
;
...
...
services/cmds/reboot/init_cmd_reboot.c
浏览文件 @
ebfe310e
...
...
@@ -32,7 +32,9 @@ int main(int argc, char* argv[])
printf
(
"%s"
,
USAGE_INFO
);
return
0
;
}
if
(
argv
[
1
]
==
NULL
)
{
return
-
1
;
}
if
(
argc
==
REBOOT_CMD_NUMBER
&&
strcmp
(
argv
[
1
],
"shutdown"
)
!=
0
&&
strcmp
(
argv
[
1
],
"updater"
)
!=
0
&&
strcmp
(
argv
[
1
],
"flash"
)
!=
0
&&
...
...
services/cmds/service_control/service_control.c
浏览文件 @
ebfe310e
...
...
@@ -67,7 +67,9 @@ int main(int argc, char** argv)
ServiceControlUsage
();
return
-
1
;
}
if
(
argv
[
0
]
==
NULL
)
{
return
-
1
;
}
char
serviceCtl
[
SERVICE_CONTROL_MAX_SIZE
];
if
(
strcmp
(
argv
[
0
],
"start_service"
)
==
0
)
{
if
(
strncpy_s
(
serviceCtl
,
sizeof
(
serviceCtl
),
"ohos.ctl.start"
,
sizeof
(
serviceCtl
)
-
1
)
!=
EOK
)
{
...
...
services/log/init_log.c
浏览文件 @
ebfe310e
...
...
@@ -83,7 +83,7 @@ void EnableDevKmsg(void)
if
(
fd
<
0
)
{
return
;
}
char
*
kmsgStatus
=
"on"
;
c
onst
c
har
*
kmsgStatus
=
"on"
;
write
(
fd
,
kmsgStatus
,
strlen
(
kmsgStatus
)
+
1
);
close
(
fd
);
fd
=
-
1
;
...
...
services/src/init_cmds.c
浏览文件 @
ebfe310e
...
...
@@ -230,7 +230,7 @@ static void WriteCommon(const char *file, char *buffer, int flags, mode_t mode)
size_t
totalSize
=
strlen
(
buffer
);
size_t
written
=
WriteAll
(
fd
,
buffer
,
totalSize
);
if
(
written
!=
totalSize
)
{
INIT_LOGE
(
"Write %lu bytes to file failed"
,
totalSize
,
file
);
INIT_LOGE
(
"Write %lu bytes to file
%s
failed"
,
totalSize
,
file
);
}
close
(
fd
);
}
...
...
@@ -389,8 +389,6 @@ static void DoCopyInernal(const char *source, const char *target)
int
srcFd
=
open
(
source
,
O_RDONLY
|
O_CLOEXEC
,
S_IRUSR
|
S_IWUSR
);
if
(
srcFd
<
0
)
{
INIT_LOGE
(
"Open
\"
%s
\"
failed, err = %d"
,
source
,
errno
);
close
(
srcFd
);
srcFd
=
-
1
;
return
;
}
...
...
@@ -1155,6 +1153,7 @@ static void DoMakeDevice(const char *cmdContent, int maxArg)
unsigned
int
major
=
strtoul
(
ctx
->
argv
[
0
],
NULL
,
DECIMAL_BASE
);
unsigned
int
minor
=
strtoul
(
ctx
->
argv
[
1
],
NULL
,
DECIMAL_BASE
);
if
(
major
==
0
||
minor
==
0
)
{
FreeCmd
(
ctx
);
return
;
}
dev_t
deviceId
=
makedev
(
major
,
minor
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录