Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
45553a12
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看板
提交
45553a12
编写于
12月 25, 2021
作者:
X
xionglei6
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
init: fix compile warnning
Signed-off-by:
N
xionglei6
<
xionglei6@huawei.com
>
上级
f4e6b3ee
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
9 addition
and
5 deletion
+9
-5
services/init/init_common_service.c
services/init/init_common_service.c
+3
-2
services/init/init_service_socket.c
services/init/init_service_socket.c
+2
-1
services/utils/init_utils.c
services/utils/init_utils.c
+1
-1
test/unittest/common/cmd_func_test.cpp
test/unittest/common/cmd_func_test.cpp
+2
-0
watchdog/init_watchdog.c
watchdog/init_watchdog.c
+1
-1
未找到文件。
services/init/init_common_service.c
浏览文件 @
45553a12
...
...
@@ -22,6 +22,7 @@
#include <stropts.h>
#endif
#include <sys/capability.h>
#include <sys/ioctl.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <time.h>
...
...
@@ -72,8 +73,8 @@ static int SetPerms(const Service *service)
"SetPerms, setgid for %s failed. %d"
,
service
->
name
,
errno
);
}
if
(
service
->
servPerm
.
gIDCnt
>
1
)
{
INIT_ERROR_CHECK
(
setgroups
(
service
->
servPerm
.
gIDCnt
-
1
,
&
service
->
servPerm
.
gIDArray
[
1
])
==
0
,
return
SERVICE_FAILURE
,
INIT_ERROR_CHECK
(
setgroups
(
service
->
servPerm
.
gIDCnt
-
1
,
(
const
gid_t
*
)
&
service
->
servPerm
.
gIDArray
[
1
])
==
0
,
return
SERVICE_FAILURE
,
"SetPerms, setgroups failed. errno = %d, gIDCnt=%d"
,
errno
,
service
->
servPerm
.
gIDCnt
);
}
if
(
service
->
servPerm
.
uID
!=
0
)
{
...
...
services/init/init_service_socket.c
浏览文件 @
45553a12
...
...
@@ -18,6 +18,7 @@
#include <fcntl.h>
#include <netinet/in.h>
#include <string.h>
#include <strings.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/uio.h>
...
...
@@ -34,7 +35,7 @@
static
int
GetSocketAddr
(
struct
sockaddr_un
*
addr
,
const
char
*
name
)
{
bzero
(
addr
,
sizeof
(
struct
sockaddr_un
));
(
void
)
memset_s
(
addr
,
sizeof
(
struct
sockaddr_un
),
0x0
,
sizeof
(
struct
sockaddr_un
));
addr
->
sun_family
=
AF_UNIX
;
size_t
addrLen
=
sizeof
(
addr
->
sun_path
);
int
ret
=
snprintf_s
(
addr
->
sun_path
,
addrLen
,
addrLen
-
1
,
HOS_SOCKET_DIR
"/%s"
,
name
);
...
...
services/utils/init_utils.c
浏览文件 @
45553a12
...
...
@@ -265,7 +265,7 @@ void WaitForFile(const char *source, unsigned int maxCount)
unsigned
int
maxCountTmp
=
maxCount
;
INIT_ERROR_CHECK
(
maxCountTmp
<=
WAIT_MAX_COUNT
,
maxCountTmp
=
WAIT_MAX_COUNT
,
"WaitForFile max time is 5s"
);
struct
stat
sourceInfo
=
{};
const
unsigned
int
waitTime
=
500000
;
unsigned
int
waitTime
=
500000
;
unsigned
int
count
=
0
;
do
{
usleep
(
waitTime
);
...
...
test/unittest/common/cmd_func_test.cpp
浏览文件 @
45553a12
...
...
@@ -37,9 +37,11 @@ const std::string TEST_DRI = ROOT_DIR + "StartInitTestDir";
const
std
::
string
TEST_FILE
=
TEST_DRI
+
"/test.txt"
;
const
std
::
string
TEST_CFG_ILLEGAL
=
TEST_DRI
+
"/illegal.cfg"
;
const
std
::
string
TEST_PROC_MOUNTS
=
"/proc/mounts"
;
#ifndef USE_EMMC_STORAGE
const
uid_t
TEST_FILE_UID
=
999
;
const
gid_t
TEST_FILE_GID
=
999
;
const
mode_t
TEST_FILE_MODE
=
S_IRUSR
|
S_IWUSR
|
S_IRGRP
|
S_IROTH
;
#endif
// init.cfg releated
const
std
::
string
CFG_FILE
=
"/etc/init.cfg"
;
...
...
watchdog/init_watchdog.c
浏览文件 @
45553a12
...
...
@@ -41,7 +41,7 @@ static void WaitAtStartup(const char *source)
{
unsigned
int
count
=
0
;
struct
stat
sourceInfo
;
const
unsigned
int
waitTime
=
500000
;
unsigned
int
waitTime
=
500000
;
do
{
usleep
(
waitTime
);
count
++
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录