Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
10f88cac
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看板
提交
10f88cac
编写于
3月 10, 2022
作者:
熊
熊磊
提交者:
Gitee
3月 10, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'OpenHarmony-3.1-Release' of gitee.com:openharmony/startup_init_lite into init_3.1
Signed-off-by:
N
xionglei
<
xionglei6@huawei.com
>
上级
556832be
7aa51aa2
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
58 addition
and
24 deletion
+58
-24
services/init/standard/init_cmds.c
services/init/standard/init_cmds.c
+23
-12
services/init/standard/init_service.c
services/init/standard/init_service.c
+24
-12
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/init/standard/init_cmds.c
浏览文件 @
10f88cac
...
...
@@ -182,18 +182,29 @@ static void DoExec(const struct CmdArgs *ctx)
INIT_ERROR_CHECK
(
ctx
!=
NULL
&&
ctx
->
argv
[
0
]
!=
NULL
,
_exit
(
0x7f
),
"DoExec: invalid arguments to exec
\"
%s
\"
"
,
ctx
->
argv
[
0
]);
#ifdef SUPPORT_PROFILER_HIDEBUG
void
*
handle
=
dlopen
(
"/system/lib/libhidebug.so"
,
RTLD_LAZY
);
if
(
handle
==
NULL
)
{
INIT_LOGE
(
"Failed to dlopen libhidebug.so, %s
\n
"
,
dlerror
());
return
;
}
bool
(
*
initParam
)();
initParam
=
(
bool
(
*
)())
dlsym
(
handle
,
"InitEnvironmentParam"
);
if
(
initParam
==
NULL
)
{
INIT_LOGE
(
"Failed to dlsym InitEnvironmentParam, %s
\n
"
,
dlerror
());
return
;
}
(
*
initParam
)(
ctx
->
argv
[
0
]);
do
{
if
(
access
(
"/system/lib/libhidebug.so"
,
F_OK
)
!=
0
)
{
INIT_LOGE
(
"access failed, errno = %d
\n
"
,
errno
);
break
;
}
void
*
handle
=
dlopen
(
"/system/lib/libhidebug.so"
,
RTLD_LAZY
);
if
(
handle
==
NULL
)
{
INIT_LOGE
(
"Failed to dlopen libhidebug.so, %s
\n
"
,
dlerror
());
break
;
}
bool
(
*
initParam
)();
initParam
=
(
bool
(
*
)())
dlsym
(
handle
,
"InitEnvironmentParam"
);
if
(
initParam
==
NULL
)
{
INIT_LOGE
(
"Failed to dlsym InitEnvironmentParam, %s
\n
"
,
dlerror
());
dlclose
(
handle
);
break
;
}
bool
ret
=
(
*
initParam
)(
ctx
->
argv
[
0
]);
if
(
!
ret
)
{
INIT_LOGE
(
"init parameters failed.
\n
"
);
}
dlclose
(
handle
);
}
while
(
0
);
#endif
int
ret
=
execv
(
ctx
->
argv
[
0
],
ctx
->
argv
);
if
(
ret
==
-
1
)
{
...
...
services/init/standard/init_service.c
浏览文件 @
10f88cac
...
...
@@ -19,6 +19,7 @@
#include <string.h>
#include <sys/param.h>
#include <sys/resource.h>
#include <unistd.h>
#include "init_group_manager.h"
#include "init.h"
...
...
@@ -87,18 +88,29 @@ int ServiceExec(const Service *service)
}
INIT_CHECK_ONLY_ELOG
(
unsetenv
(
"UV_THREADPOOL_SIZE"
)
==
0
,
"set UV_THREADPOOL_SIZE error : %d."
,
errno
);
#ifdef SUPPORT_PROFILER_HIDEBUG
void
*
handle
=
dlopen
(
"/system/lib/libhidebug.so"
,
RTLD_LAZY
);
if
(
handle
==
NULL
)
{
INIT_LOGE
(
"Failed to dlopen libhidebug.so, %s
\n
"
,
dlerror
());
return
SERVICE_FAILURE
;
}
bool
(
*
initParam
)();
initParam
=
(
bool
(
*
)())
dlsym
(
handle
,
"InitEnvironmentParam"
);
if
(
initParam
==
NULL
)
{
INIT_LOGE
(
"Failed to dlsym InitEnvironmentParam, %s
\n
"
,
dlerror
());
return
SERVICE_FAILURE
;
}
(
*
initParam
)(
service
->
name
);
do
{
if
(
access
(
"/system/lib/libhidebug.so"
,
F_OK
)
!=
0
)
{
INIT_LOGE
(
"access failed, errno = %d
\n
"
,
errno
);
break
;
}
void
*
handle
=
dlopen
(
"/system/lib/libhidebug.so"
,
RTLD_LAZY
);
if
(
handle
==
NULL
)
{
INIT_LOGE
(
"Failed to dlopen libhidebug.so, %s
\n
"
,
dlerror
());
break
;
}
bool
(
*
initParam
)();
initParam
=
(
bool
(
*
)())
dlsym
(
handle
,
"InitEnvironmentParam"
);
if
(
initParam
==
NULL
)
{
INIT_LOGE
(
"Failed to dlsym InitEnvironmentParam, %s
\n
"
,
dlerror
());
dlclose
(
handle
);
break
;
}
bool
ret
=
(
*
initParam
)(
service
->
name
);
if
(
!
ret
)
{
INIT_LOGE
(
"init parameters failed.
\n
"
);
}
dlclose
(
handle
);
}
while
(
0
);
#endif
// L2 Can not be reset env
if
(
service
->
extraArgs
.
argv
!=
NULL
&&
service
->
extraArgs
.
count
>
0
)
{
...
...
services/param/watcher/agent/watcher_manager_proxy.cpp
浏览文件 @
10f88cac
...
...
@@ -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
浏览文件 @
10f88cac
...
...
@@ -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
浏览文件 @
10f88cac
...
...
@@ -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
浏览文件 @
10f88cac
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录