Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Appspawn Lite
提交
b8628095
S
Startup Appspawn Lite
项目概览
OpenHarmony
/
Startup Appspawn Lite
大约 1 年 前同步成功
通知
4
Star
43
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Appspawn Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
b8628095
编写于
3月 29, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 29, 2022
浏览文件
操作
浏览文件
下载
差异文件
!26 fix: inner source issue
Merge pull request !26 from 熊磊/0329xytinnersource
上级
6fa2beb4
d1eb2f96
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
17 addition
and
17 deletion
+17
-17
services/include/appspawn_message.h
services/include/appspawn_message.h
+1
-1
services/include/appspawn_process.h
services/include/appspawn_process.h
+1
-1
services/include/appspawn_service.h
services/include/appspawn_service.h
+1
-1
services/src/appspawn_message.c
services/src/appspawn_message.c
+1
-1
services/src/appspawn_process.c
services/src/appspawn_process.c
+7
-7
services/src/appspawn_service.c
services/src/appspawn_service.c
+4
-4
services/test/unittest/common/message_func_test.cpp
services/test/unittest/common/message_func_test.cpp
+2
-2
未找到文件。
services/include/appspawn_message.h
浏览文件 @
b8628095
...
...
@@ -40,4 +40,4 @@ void FreeMessageSt(MessageSt* targetSt);
#endif
#endif
#endif // BASE_STARTUP_APPSPAWN_SERVICE_H
\ No newline at end of file
#endif // BASE_STARTUP_APPSPAWN_SERVICE_H
services/include/appspawn_process.h
浏览文件 @
b8628095
...
...
@@ -32,4 +32,4 @@ pid_t CreateProcess(const MessageSt* msgSt);
#endif
#endif
#endif // BASE_STARTUP_APPSPAWN_SERVICE_H
\ No newline at end of file
#endif // BASE_STARTUP_APPSPAWN_SERVICE_H
services/include/appspawn_service.h
浏览文件 @
b8628095
...
...
@@ -34,4 +34,4 @@ enum APPSPAWN_FUNCID {
#endif
#endif
#endif // BASE_STARTUP_APPSPAWN_SERVICE_H
\ No newline at end of file
#endif // BASE_STARTUP_APPSPAWN_SERVICE_H
services/src/appspawn_message.c
浏览文件 @
b8628095
...
...
@@ -138,7 +138,7 @@ static int GetCaps(const cJSON* curItem, MessageSt* msgSt)
}
msgSt
->
caps
[
i
]
=
(
unsigned
int
)
cJSON_GetNumberValue
(
capJ
);
if
(
msgSt
->
caps
[
i
]
>
CAP_LAST_CAP
)
{
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] GetCaps, invalid cap value %{public}u detected!"
,
\
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] GetCaps, invalid cap value %{public}u detected!"
,
\
msgSt
->
caps
[
i
]);
free
(
msgSt
->
caps
);
msgSt
->
caps
=
NULL
;
...
...
services/src/appspawn_process.c
浏览文件 @
b8628095
...
...
@@ -76,19 +76,19 @@ static int SetPerms(uid_t uID, gid_t gID, unsigned int capsCnt, const unsigned i
gid_t
groups
[
GRP_NUM
];
if
(
KeepCapability
()
!=
0
)
{
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] KeepCapability failed, uID %{public}u, err: %{public}d."
,
\
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] KeepCapability failed, uID %{public}u, err: %{public}d."
,
\
uID
,
errno
);
return
-
1
;
}
if
(
setgid
(
gID
)
!=
0
)
{
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] setgid failed, gID %{public}u, err: %{public}d."
,
\
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] setgid failed, gID %{public}u, err: %{public}d."
,
\
gID
,
errno
);
return
-
1
;
}
if
(
setuid
(
uID
)
!=
0
)
{
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] setuid failed, uID %{public}u, err: %{public}d."
,
\
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] setuid failed, uID %{public}u, err: %{public}d."
,
\
uID
,
errno
);
return
-
1
;
}
...
...
@@ -98,7 +98,7 @@ static int SetPerms(uid_t uID, gid_t gID, unsigned int capsCnt, const unsigned i
groups
[
0
]
=
gID
;
groups
[
1
]
=
DEVMGR_GRP
;
if
(
setgroups
(
GRP_NUM
,
groups
))
{
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] setgroups failed, uID %{public}u, err: %{public}d."
,
\
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] setgroups failed, uID %{public}u, err: %{public}d."
,
\
uID
,
errno
);
return
-
1
;
}
...
...
@@ -144,7 +144,7 @@ pid_t CreateProcess(const MessageSt* msgSt)
#ifdef OHOS_DEBUG
struct
timespec
tmStart
=
{
0
};
if
(
clock_gettime
(
CLOCK_REALTIME
,
&
tmStart
)
!=
0
)
{
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] sub-process, pid %{public}d. get time err %{public}d."
,
\
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] sub-process, pid %{public}d. get time err %{public}d."
,
\
getpid
(),
errno
);
}
#endif // OHOS_DEBUG
...
...
@@ -160,12 +160,12 @@ pid_t CreateProcess(const MessageSt* msgSt)
#ifdef OHOS_DEBUG
struct
timespec
tmEnd
=
{
0
};
if
(
clock_gettime
(
CLOCK_REALTIME
,
&
tmEnd
)
!=
0
)
{
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] sub-process, pid %{public}d. get time2 err %{public}d."
,
\
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] sub-process, pid %{public}d. get time2 err %{public}d."
,
\
getpid
(),
errno
);
}
// 1s = 1000000000ns
long
timeUsed
=
(
tmEnd
.
tv_sec
-
tmStart
.
tv_sec
)
*
1000000000L
+
(
tmEnd
.
tv_nsec
-
tmStart
.
tv_nsec
);
HILOG_INFO
(
HILOG_MODULE_HIVIEW
,
"[appspawn] sub-process, pid %{public}d, timeused %ld ns."
,
\
HILOG_INFO
(
HILOG_MODULE_HIVIEW
,
"[appspawn] sub-process, pid %{public}d, timeused %ld ns."
,
\
getpid
(),
timeUsed
);
#endif // OHOS_DEBUG
...
...
services/src/appspawn_service.c
浏览文件 @
b8628095
...
...
@@ -62,7 +62,7 @@ static BOOL Initialize(Service* service, Identity identity)
AppSpawnService
*
spawnService
=
(
AppSpawnService
*
)
service
;
spawnService
->
identity
=
identity
;
HILOG_INFO
(
HILOG_MODULE_HIVIEW
,
"[appspawn] initialize, identity<%{public}d, %{public}d, %{public}p>"
,
\
HILOG_INFO
(
HILOG_MODULE_HIVIEW
,
"[appspawn] initialize, identity<%{public}d, %{public}d, %{public}p>"
,
\
identity
.
serviceId
,
identity
.
featureId
,
identity
.
queueId
);
return
TRUE
;
}
...
...
@@ -136,7 +136,7 @@ static int Invoke(IServerProxy* iProxy, int funcId, void* origin, IpcIo* req, Ip
(
void
)
origin
;
if
(
reply
==
NULL
||
funcId
!=
ID_CALL_CREATE_SERVICE
||
req
==
NULL
)
{
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] invoke, funcId %{public}d invalid, reply %{public}d."
,
\
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] invoke, funcId %{public}d invalid, reply %{public}d."
,
\
funcId
,
INVALID_PID
);
IpcIoPushInt64
(
reply
,
INVALID_PID
);
return
EC_BADPTR
;
...
...
@@ -149,7 +149,7 @@ static int Invoke(IServerProxy* iProxy, int funcId, void* origin, IpcIo* req, Ip
return
EC_FAILURE
;
}
HILOG_INFO
(
HILOG_MODULE_HIVIEW
,
"[appspawn] invoke, msg<%{public}s,%{public}s,%{public}d,%{public}d>"
,
\
HILOG_INFO
(
HILOG_MODULE_HIVIEW
,
"[appspawn] invoke, msg<%{public}s,%{public}s,%{public}d,%{public}d>"
,
\
msgSt
.
bundleName
,
msgSt
.
identityID
,
msgSt
.
uID
,
msgSt
.
gID
);
pid_t
newPid
=
CreateProcess
(
&
msgSt
);
...
...
@@ -162,7 +162,7 @@ static int Invoke(IServerProxy* iProxy, int funcId, void* origin, IpcIo* req, Ip
// 1s = 1000000000ns
long
timeUsed
=
(
tmEnd
.
tv_sec
-
tmStart
.
tv_sec
)
*
1000000000L
+
(
tmEnd
.
tv_nsec
-
tmStart
.
tv_nsec
);
HILOG_INFO
(
HILOG_MODULE_HIVIEW
,
"[appspawn] invoke, reply pid %{public}d, timeused %{public}ld ns."
,
\
HILOG_INFO
(
HILOG_MODULE_HIVIEW
,
"[appspawn] invoke, reply pid %{public}d, timeused %{public}ld ns."
,
\
newPid
,
timeUsed
);
#else
HILOG_INFO
(
HILOG_MODULE_HIVIEW
,
"[appspawn] invoke, reply pid %{public}d."
,
newPid
);
...
...
services/test/unittest/common/message_func_test.cpp
浏览文件 @
b8628095
...
...
@@ -208,7 +208,7 @@ HWTEST_F(StartupAppspawnUTest, msgFuncFreeTest_002, TestSize.Level1)
static
void
GetCurrentTime
(
struct
timespec
*
tmCur
)
{
if
(
tmCur
==
NULL
)
{
if
(
tmCur
==
nullptr
)
{
return
;
}
if
(
clock_gettime
(
CLOCK_REALTIME
,
tmCur
)
!=
0
)
{
...
...
@@ -247,7 +247,7 @@ HWTEST_F(StartupAppspawnUTest, msgFuncSplitTest_001, TestSize.Level1)
struct
timespec
tmEnd
=
{
0
};
GetCurrentTime
(
&
tmEnd
);
long
timeUsed
=
(
tmEnd
.
tv_sec
-
tmStart
.
tv_sec
)
*
NANOSECONDS_PER_SECOND
+
(
tmEnd
.
tv_nsec
-
tmStart
.
tv_nsec
);
printf
(
"[----------] StartupAppspawnUTest, msgFuncSplitTest_001, total time %ld ns, strCnt %u.
\n
"
,
\
printf
(
"[----------] StartupAppspawnUTest, msgFuncSplitTest_001, total time %ld ns, strCnt %u.
\n
"
,
\
timeUsed
,
g_badStrings
.
size
());
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录