Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
6cf47e68
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看板
提交
6cf47e68
编写于
5月 27, 2022
作者:
M
Mupceet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
init: fix codedex
Signed-off-by:
N
Mupceet
<
laiguizhong@huawei.com
>
上级
81999aeb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
7 deletion
+19
-7
interfaces/innerkits/control_fd/control_fd.h
interfaces/innerkits/control_fd/control_fd.h
+2
-1
interfaces/innerkits/control_fd/control_fd_client.c
interfaces/innerkits/control_fd/control_fd_client.c
+14
-5
interfaces/innerkits/control_fd/control_fd_service.c
interfaces/innerkits/control_fd/control_fd_service.c
+0
-1
interfaces/innerkits/sandbox/BUILD.gn
interfaces/innerkits/sandbox/BUILD.gn
+3
-0
未找到文件。
interfaces/innerkits/control_fd/control_fd.h
浏览文件 @
6cf47e68
...
...
@@ -17,6 +17,7 @@
#define CONTROL_FD_
#include <stdint.h>
#include <fcntl.h>
#include "loop_event.h"
#ifdef __cplusplus
...
...
@@ -53,7 +54,7 @@ typedef enum {
typedef
struct
{
uint16_t
msgSize
;
uint16_t
type
;
uint32
_t
pid
;
pid
_t
pid
;
char
fifoName
[
FIFO_PATH_SIZE
];
char
cmd
[
0
];
}
CmdMessage
;
...
...
interfaces/innerkits/control_fd/control_fd_client.c
浏览文件 @
6cf47e68
...
...
@@ -118,17 +118,26 @@ static void CmdDisConnectComplete(const TaskHandle client)
static
void
CmdAgentInit
(
WatcherHandle
handle
,
const
char
*
path
,
bool
read
,
ProcessWatchEvent
func
)
{
if
(
path
==
NULL
)
{
BEGET_LOGE
(
"[control_fd] Invaild parameter"
);
return
;
}
BEGET_LOGI
(
"[control_fd] client open %s"
,
(
read
?
"read"
:
"write"
));
char
*
realPath
=
GetRealPath
(
path
);
if
(
realPath
==
NULL
)
{
BEGET_LOGE
(
"[control_fd] Failed get real path %s"
,
path
);
return
;
}
if
(
read
==
true
)
{
g_FifoReadFd
=
open
(
p
ath
,
O_RDONLY
|
O_TRUNC
|
O_NONBLOCK
);
BEGET_ERROR_CHECK
(
g_FifoReadFd
>=
0
,
return
,
"[control_fd] Failed to open fifo read"
);
g_FifoReadFd
=
open
(
realP
ath
,
O_RDONLY
|
O_TRUNC
|
O_NONBLOCK
);
BEGET_ERROR_CHECK
(
g_FifoReadFd
>=
0
,
free
(
realPath
);
return
,
"[control_fd] Failed to open fifo read"
);
BEGET_LOGI
(
"[control_fd] g_FifoReadFd is %d"
,
g_FifoReadFd
);
}
else
{
g_FifoWriteFd
=
open
(
p
ath
,
O_WRONLY
|
O_TRUNC
);
BEGET_ERROR_CHECK
(
g_FifoWriteFd
>=
0
,
return
,
"[control_fd] Failed to open fifo write"
);
g_FifoWriteFd
=
open
(
realP
ath
,
O_WRONLY
|
O_TRUNC
);
BEGET_ERROR_CHECK
(
g_FifoWriteFd
>=
0
,
free
(
realPath
);
return
,
"[control_fd] Failed to open fifo write"
);
BEGET_LOGI
(
"[control_fd] g_FifoWriteFd is %d"
,
g_FifoWriteFd
);
}
free
(
realPath
);
// start watcher for stdin
LE_WatchInfo
info
=
{};
info
.
flags
=
0
;
...
...
interfaces/innerkits/control_fd/control_fd_service.c
浏览文件 @
6cf47e68
...
...
@@ -16,7 +16,6 @@
#include <stdbool.h>
#include <sys/wait.h>
#include <unistd.h>
#include <sys/wait.h>
#include "beget_ext.h"
#include "control_fd.h"
...
...
interfaces/innerkits/sandbox/BUILD.gn
浏览文件 @
6cf47e68
...
...
@@ -63,5 +63,8 @@ ohos_static_library("libsandbox_static") {
"//base/startup/init_lite/services/utils:libinit_utils",
"//third_party/cJSON:cjson_static",
]
if (target_cpu == "arm64") {
defines = [ "SUPPORT_64BIT" ]
}
part_name = "init"
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录