Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Appspawn Lite
提交
1f372278
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,发现更多精彩内容 >>
未验证
提交
1f372278
编写于
5月 10, 2022
作者:
O
openharmony_ci
提交者:
Gitee
5月 10, 2022
浏览文件
操作
浏览文件
下载
差异文件
!29 ipc统一接口切换
Merge pull request !29 from 周礼亭/master
上级
f1c8b21a
781ddc69
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
7 addition
and
22 deletion
+7
-22
bundle.json
bundle.json
+1
-1
services/BUILD.gn
services/BUILD.gn
+1
-1
services/src/appspawn_service.c
services/src/appspawn_service.c
+5
-20
未找到文件。
bundle.json
浏览文件 @
1f372278
...
...
@@ -23,7 +23,7 @@
"components"
:
[
"hilog_lite"
,
"samgr_lite"
,
"ipc_
lit
e"
,
"ipc_
singl
e"
,
"kv_store"
,
"aafwk_lite"
,
"ace_engine_lite"
,
...
...
services/BUILD.gn
浏览文件 @
1f372278
...
...
@@ -51,7 +51,7 @@ executable("appspawn") {
deps = [
"${aafwk_lite_path}/frameworks/ability_lite:aafwk_abilitykit_lite",
"//build/lite/config/component/cJSON:cjson_shared",
"//foundation/communication/ipc
_lite:liteipc_adapter
",
"//foundation/communication/ipc
/interfaces/innerkits/c/ipc:ipc_single
",
"//foundation/distributeddatamgr/appdatamgr/frameworks/native/kv_store:kv_store",
"//foundation/distributedschedule/samgr_lite/samgr:samgr",
"//third_party/bounds_checking_function:libsec_shared",
...
...
services/src/appspawn_service.c
浏览文件 @
1f372278
...
...
@@ -24,7 +24,7 @@
#include "appspawn_process.h"
#include "iproxy_server.h"
#include "iunknown.h"
#include "
liteipc_adapter
.h"
#include "
ipc_skeleton
.h"
#include "log.h"
#include "message.h"
#include "ohos_errno.h"
...
...
@@ -99,29 +99,14 @@ static int GetMessageSt(MessageSt* msgSt, IpcIo* req)
if
(
msgSt
==
NULL
||
req
==
NULL
)
{
return
EC_FAILURE
;
}
#ifdef __LINUX__
size_t
len
=
0
;
char
*
str
=
IpcIoPop
String
(
req
,
&
len
);
char
*
str
=
Read
String
(
req
,
&
len
);
if
(
str
==
NULL
||
len
==
0
)
{
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] invoke, get data failed."
);
return
EC_FAILURE
;
}
int
ret
=
SplitMessage
(
str
,
len
,
msgSt
);
// after split message, str no need to free(linux version)
#else
BuffPtr
*
dataPtr
=
IpcIoPopDataBuff
(
req
);
if
(
dataPtr
==
NULL
)
{
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] invoke, get data failed."
);
return
EC_FAILURE
;
}
int
ret
=
SplitMessage
((
char
*
)
dataPtr
->
buff
,
dataPtr
->
buffSz
,
msgSt
);
// release buffer
if
(
FreeBuffer
(
NULL
,
dataPtr
->
buff
)
!=
LITEIPC_OK
)
{
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] invoke, free buffer failed!"
);
}
#endif
return
ret
;
}
...
...
@@ -138,14 +123,14 @@ static int Invoke(IServerProxy* iProxy, int funcId, void* origin, IpcIo* req, Ip
if
(
reply
==
NULL
||
funcId
!=
ID_CALL_CREATE_SERVICE
||
req
==
NULL
)
{
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] invoke, funcId %{public}d invalid, reply %{public}d."
,
\
funcId
,
INVALID_PID
);
IpcIoPush
Int64
(
reply
,
INVALID_PID
);
Write
Int64
(
reply
,
INVALID_PID
);
return
EC_BADPTR
;
}
MessageSt
msgSt
=
{
0
};
if
(
GetMessageSt
(
&
msgSt
,
req
)
!=
EC_SUCCESS
)
{
HILOG_ERROR
(
HILOG_MODULE_HIVIEW
,
"[appspawn] invoke, parse failed! reply %{public}d."
,
INVALID_PID
);
IpcIoPush
Int64
(
reply
,
INVALID_PID
);
Write
Int64
(
reply
,
INVALID_PID
);
return
EC_FAILURE
;
}
...
...
@@ -154,7 +139,7 @@ static int Invoke(IServerProxy* iProxy, int funcId, void* origin, IpcIo* req, Ip
pid_t
newPid
=
CreateProcess
(
&
msgSt
);
FreeMessageSt
(
&
msgSt
);
IpcIoPush
Int64
(
reply
,
newPid
);
Write
Int64
(
reply
,
newPid
);
#ifdef OHOS_DEBUG
struct
timespec
tmEnd
=
{
0
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录