Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
19f8cae0
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,发现更多精彩内容 >>
提交
19f8cae0
编写于
3月 08, 2022
作者:
X
xlei1030
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FIX:处理InterfaceToken校验 和 异常分支添加va_end处理问题
Signed-off-by:
N
xlei1030
<
xionglei6@huawei.com
>
上级
58a8bbb3
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
13 addition
and
0 deletion
+13
-0
services/log/init_log.c
services/log/init_log.c
+2
-0
services/param/watcher/agent/watcher_manager_proxy.cpp
services/param/watcher/agent/watcher_manager_proxy.cpp
+2
-0
services/param/watcher/agent/watcher_stub.cpp
services/param/watcher/agent/watcher_stub.cpp
+4
-0
services/param/watcher/proxy/watcher_manager_stub.cpp
services/param/watcher/proxy/watcher_manager_stub.cpp
+4
-0
services/param/watcher/proxy/watcher_proxy.cpp
services/param/watcher/proxy/watcher_proxy.cpp
+1
-0
未找到文件。
services/log/init_log.c
浏览文件 @
19f8cae0
...
...
@@ -105,6 +105,7 @@ void InitLogInit(const char *outFileName, InitLogLevel logLevel, const char *kLe
if
(
vsnprintf_s
(
tmpFmt
,
MAX_LOG_SIZE
,
MAX_LOG_SIZE
-
1
,
fmt
,
vargs
)
==
-
1
)
{
close
(
g_fd
);
g_fd
=
-
1
;
va_end
(
vargs
);
return
;
}
...
...
@@ -113,6 +114,7 @@ void InitLogInit(const char *outFileName, InitLogLevel logLevel, const char *kLe
kLevel
,
getpid
(),
"INIT"
,
LOG_LEVEL_STR
[
logLevel
],
tmpFmt
)
==
-
1
)
{
close
(
g_fd
);
g_fd
=
-
1
;
va_end
(
vargs
);
return
;
}
va_end
(
vargs
);
...
...
services/param/watcher/agent/watcher_manager_proxy.cpp
浏览文件 @
19f8cae0
...
...
@@ -25,6 +25,7 @@ uint32_t WatcherManagerProxy::AddWatcher(const std::string &keyPrefix, const spt
WATCHER_CHECK
(
remote
!=
nullptr
,
return
0
,
"Can not get remote"
);
MessageParcel
data
;
data
.
WriteInterfaceToken
(
WatcherManagerProxy
::
GetDescriptor
());
data
.
WriteString
(
keyPrefix
);
bool
ret
=
data
.
WriteRemoteObject
(
watcher
->
AsObject
());
WATCHER_CHECK
(
ret
,
return
0
,
"Can not get remote"
);
...
...
@@ -42,6 +43,7 @@ int32_t WatcherManagerProxy::DelWatcher(const std::string &keyPrefix, uint32_t w
WATCHER_CHECK
(
remote
!=
nullptr
,
return
ERR_FLATTEN_OBJECT
,
"Can not get remote"
);
MessageParcel
data
;
data
.
WriteInterfaceToken
(
WatcherManagerProxy
::
GetDescriptor
());
data
.
WriteString
(
keyPrefix
);
data
.
WriteUint32
(
watcherId
);
MessageParcel
reply
;
...
...
services/param/watcher/agent/watcher_stub.cpp
浏览文件 @
19f8cae0
...
...
@@ -22,6 +22,10 @@ namespace OHOS {
namespace
init_param
{
int32_t
WatcherStub
::
OnRemoteRequest
(
uint32_t
code
,
MessageParcel
&
data
,
MessageParcel
&
reply
,
MessageOption
&
option
)
{
std
::
u16string
myDescripter
=
IWatcher
::
GetDescriptor
();
std
::
u16string
remoteDescripter
=
data
.
ReadInterfaceToken
();
WATCHER_CHECK
(
myDescripter
==
remoteDescripter
,
return
-
1
,
"Invalid remoteDescripter"
);
switch
(
code
)
{
case
PARAM_CHANGE
:
{
std
::
string
name
=
data
.
ReadString
();
...
...
services/param/watcher/proxy/watcher_manager_stub.cpp
浏览文件 @
19f8cae0
...
...
@@ -21,6 +21,10 @@ namespace init_param {
int32_t
WatcherManagerStub
::
OnRemoteRequest
(
uint32_t
code
,
MessageParcel
&
data
,
MessageParcel
&
reply
,
MessageOption
&
option
)
{
std
::
u16string
myDescripter
=
IWatcherManager
::
GetDescriptor
();
std
::
u16string
remoteDescripter
=
data
.
ReadInterfaceToken
();
WATCHER_CHECK
(
myDescripter
==
remoteDescripter
,
return
-
1
,
"Invalid remoteDescripter"
);
switch
(
code
)
{
case
ADD_WATCHER
:
{
std
::
string
key
=
data
.
ReadString
();
...
...
services/param/watcher/proxy/watcher_proxy.cpp
浏览文件 @
19f8cae0
...
...
@@ -32,6 +32,7 @@ void WatcherProxy::OnParamerterChange(const std::string &name, const std::string
auto
remote
=
Remote
();
WATCHER_CHECK
(
remote
!=
nullptr
,
return
,
"Can not get remote"
);
data
.
WriteInterfaceToken
(
WatcherProxy
::
GetDescriptor
());
data
.
WriteString
(
name
);
data
.
WriteString
(
value
);
int
ret
=
remote
->
SendRequest
(
PARAM_CHANGE
,
data
,
reply
,
option
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录