Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
9f5f6c9c
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看板
提交
9f5f6c9c
编写于
5月 27, 2022
作者:
M
Mupceet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug init
Signed-off-by:
N
Mupceet
<
laiguizhong@huawei.com
>
上级
54859a3e
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
19 addition
and
27 deletion
+19
-27
device_info/BUILD.gn
device_info/BUILD.gn
+1
-5
interfaces/innerkits/BUILD.gn
interfaces/innerkits/BUILD.gn
+2
-13
services/begetctl/main.c
services/begetctl/main.c
+1
-1
services/begetctl/shell/shell_main.c
services/begetctl/shell/shell_main.c
+0
-1
services/log/init_log.c
services/log/init_log.c
+7
-2
services/loopevent/loop/le_loop.c
services/loopevent/loop/le_loop.c
+0
-1
services/param/linux/param_request.c
services/param/linux/param_request.c
+5
-3
services/param/manager/param_manager.c
services/param/manager/param_manager.c
+1
-1
services/param/manager/param_trie.c
services/param/manager/param_trie.c
+2
-0
未找到文件。
device_info/BUILD.gn
浏览文件 @
9f5f6c9c
...
...
@@ -40,11 +40,7 @@ ohos_shared_library("deviceinfoservice") {
]
deps = [
"//base/startup/init_lite/services/log:agent_log",
"//base/startup/init_lite/services/loopevent:loopevent",
"//base/startup/init_lite/services/param:param_client",
"//base/startup/init_lite/services/utils:libinit_tools",
"//base/startup/init_lite/services/utils:libinit_utils",
"//base/startup/init_lite/interfaces/innerkits:libbegetutil",
"//third_party/bounds_checking_function:libsec_shared",
"//third_party/openssl:libcrypto_shared",
]
...
...
interfaces/innerkits/BUILD.gn
浏览文件 @
9f5f6c9c
...
...
@@ -226,8 +226,10 @@ if (defined(ohos_lite)) {
]
deps = [
":libbegetutil",
"//base/startup/init_lite/services/utils:libinit_utils",
"//third_party/bounds_checking_function:libsec_shared",
"//third_party/openssl:libcrypto_shared",
]
if (enable_ohos_startup_init_feature_watcher) {
...
...
@@ -241,12 +243,6 @@ if (defined(ohos_lite)) {
"//base/startup/init_lite/services/param/watcher/include",
"//base/startup/init_lite/services/log",
]
deps += [
"//base/startup/init_lite/services/param:param_client",
"//base/startup/init_lite/services/utils:libinit_tools",
"//base/startup/init_lite/services/utils:libinit_utils",
"//third_party/openssl:libcrypto_shared",
]
} else {
defines += [ "NO_PARAM_WATCHER" ]
}
...
...
@@ -261,13 +257,6 @@ if (defined(ohos_lite)) {
sources += [
"//base/startup/init_lite/interfaces/innerkits/syspara/param_comm.c",
]
deps += [
"//base/startup/init_lite/services/loopevent:loopevent",
"//base/startup/init_lite/services/param:param_client",
"//base/startup/init_lite/services/utils:libinit_tools",
"//base/startup/init_lite/services/utils:libinit_utils",
"//third_party/openssl:libcrypto_shared",
]
}
external_deps = [
...
...
services/begetctl/main.c
浏览文件 @
9f5f6c9c
...
...
@@ -74,7 +74,7 @@ int main(int argc, char *argv[])
printf
(
"Failed to get shell handle
\n
"
);
return
0
;
}
SetInitLogLevel
(
0
);
BShellParamCmdRegister
(
handle
,
0
);
#ifdef INIT_TEST
BShellCmdRegister
(
handle
,
0
);
...
...
services/begetctl/shell/shell_main.c
浏览文件 @
9f5f6c9c
...
...
@@ -73,7 +73,6 @@ int main(int argc, char *args[])
tio
.
c_cc
[
VMIN
]
=
1
;
tcsetattr
(
0
,
TCSAFLUSH
,
&
tio
);
SetInitLogLevel
(
0
);
BSH_LOGV
(
"BShellEnvStart %d"
,
argc
);
do
{
BShellHandle
handle
=
GetShellHandle
();
...
...
services/log/init_log.c
浏览文件 @
9f5f6c9c
...
...
@@ -32,6 +32,7 @@
#include "hilog_base/log_base.h"
#endif
#define DEF_LOG_SIZE 128
#define MAX_LOG_SIZE 1024
#define BASE_YEAR 1900
...
...
@@ -105,9 +106,13 @@ void InitLog(InitLogLevel logLevel, unsigned int domain, const char *tag, const
}
va_list
vargs
;
va_start
(
vargs
,
fmt
);
char
tmpFmt
[
MAX
_LOG_SIZE
]
=
{
0
};
if
(
vsnprintf_s
(
tmpFmt
,
MAX_LOG_SIZE
,
MAX_LOG_SIZE
-
1
,
fmt
,
vargs
)
==
-
1
)
{
char
tmpFmt
[
DEF
_LOG_SIZE
]
=
{
0
};
if
(
vsnprintf_s
(
tmpFmt
,
sizeof
(
tmpFmt
),
sizeof
(
tmpFmt
)
-
1
,
fmt
,
vargs
)
==
-
1
)
{
va_end
(
vargs
);
#ifdef OHOS_LITE
static
LogLevel
LOG_LEVEL
[]
=
{
LOG_DEBUG
,
LOG_INFO
,
LOG_WARN
,
LOG_ERROR
,
LOG_FATAL
};
(
void
)
HiLogPrint
(
INIT_LOG_INIT
,
LOG_LEVEL
[
logLevel
],
domain
,
tag
,
"%{public}s"
,
fmt
);
#endif
return
;
}
va_end
(
vargs
);
...
...
services/loopevent/loop/le_loop.c
浏览文件 @
9f5f6c9c
...
...
@@ -92,7 +92,6 @@ LE_STATUS ProcessEvent(const EventLoop *loop, int fd, uint32_t oper)
}
task
->
handleEvent
((
LoopHandle
)
loop
,
(
TaskHandle
)
task
,
oper
);
}
else
{
LE_LOGE
(
"ProcessEvent can not find task for %d"
,
fd
);
loop
->
delEvent
(
loop
,
fd
,
oper
);
}
return
LE_SUCCESS
;
...
...
services/param/linux/param_request.c
浏览文件 @
9f5f6c9c
...
...
@@ -44,13 +44,13 @@ static int InitParamClient(void)
if
(
PARAM_TEST_FLAG
(
g_clientSpace
.
flags
,
WORKSPACE_FLAGS_INIT
))
{
return
0
;
}
PARAM_LOG
V
(
"InitParamClient"
);
PARAM_LOG
I
(
"InitParamClient %p"
,
&
g_clientSpace
);
pthread_mutex_init
(
&
g_clientSpace
.
mutex
,
NULL
);
g_clientSpace
.
clientFd
=
INVALID_SOCKET
;
int
ret
=
InitParamWorkSpace
(
1
);
PARAM_CHECK
(
ret
==
0
,
return
-
1
,
"Failed to init param workspace"
);
PARAM_SET_FLAG
(
g_clientSpace
.
flags
,
WORKSPACE_FLAGS_INIT
);
PARAM_LOGI
(
"InitParamClient
finish"
);
PARAM_LOGI
(
"InitParamClient
%p finish"
,
&
g_clientSpace
);
return
0
;
}
...
...
@@ -64,6 +64,7 @@ void ClientInit(void)
void
ClientDeinit
(
void
)
{
PARAM_LOGI
(
"ClientDeinit %p"
,
&
g_clientSpace
);
#ifndef STARTUP_INIT_TEST
if
(
PARAM_TEST_FLAG
(
g_clientSpace
.
flags
,
WORKSPACE_FLAGS_INIT
))
{
CloseParamWorkSpace
();
...
...
@@ -74,6 +75,7 @@ void ClientDeinit(void)
}
PARAM_SET_FLAG
(
g_clientSpace
.
flags
,
0
);
pthread_mutex_destroy
(
&
g_clientSpace
.
mutex
);
PARAM_LOGI
(
"ClientDeinit %p finish"
,
&
g_clientSpace
);
}
static
int
ProcessRecvMsg
(
const
ParamMessage
*
recvMsg
)
...
...
@@ -177,7 +179,6 @@ int SystemSetParameter(const char *name, const char *value)
request
->
msgSize
=
offset
+
sizeof
(
ParamMessage
);
request
->
id
.
msgId
=
atomic_fetch_add
(
&
g_requestId
,
1
);
PARAM_LOGV
(
"SystemSetParameter name %s"
,
name
);
int
fd
=
INVALID_SOCKET
;
pthread_mutex_lock
(
&
g_clientSpace
.
mutex
);
if
(
g_clientSpace
.
clientFd
==
INVALID_SOCKET
)
{
...
...
@@ -188,6 +189,7 @@ int SystemSetParameter(const char *name, const char *value)
PARAM_CHECK
(
fd
>
0
,
return
-
1
,
"Failed to connect server for set %s"
,
name
);
ret
=
StartRequest
(
fd
,
request
,
DEFAULT_PARAM_SET_TIMEOUT
);
free
(
request
);
PARAM_LOGI
(
"SystemSetParameter name %s %d"
,
name
,
ret
);
return
ret
;
}
...
...
services/param/manager/param_manager.c
浏览文件 @
9f5f6c9c
...
...
@@ -117,6 +117,7 @@ PARAM_STATIC int RegisterSecurityOps(int onlyRead)
int
InitParamWorkSpace
(
int
onlyRead
)
{
PARAM_LOGI
(
"InitParamWorkSpace %p"
,
&
g_paramWorkSpace
);
if
(
PARAM_TEST_FLAG
(
g_paramWorkSpace
.
flags
,
WORKSPACE_FLAGS_INIT
))
{
return
0
;
}
...
...
@@ -695,7 +696,6 @@ WorkSpace *GetWorkSpace(const char *name)
space
=
HASHMAP_ENTRY
(
node
,
WorkSpace
,
hashNode
);
}
WORKSPACE_RW_UNLOCK
(
g_paramWorkSpace
);
PARAM_LOGV
(
"GetWorkSpace %s space-name %s, space %p"
,
name
,
tmpName
,
space
);
return
(
space
!=
NULL
&&
space
->
area
!=
NULL
)
?
space
:
NULL
;
}
...
...
services/param/manager/param_trie.c
浏览文件 @
9f5f6c9c
...
...
@@ -112,12 +112,14 @@ int InitWorkSpace(WorkSpace *workSpace, int onlyRead, uint32_t spaceSize)
PARAM_CHECK
(
ret
==
0
,
return
ret
,
"Failed to init workspace %s"
,
workSpace
->
fileName
);
PARAMSPACE_AREA_INIT_LOCK
(
workSpace
);
PARAM_SET_FLAG
(
workSpace
->
flags
,
WORKSPACE_FLAGS_INIT
);
PARAM_LOGI
(
"InitWorkSpace %s"
,
workSpace
->
fileName
);
return
ret
;
}
void
CloseWorkSpace
(
WorkSpace
*
workSpace
)
{
PARAM_CHECK
(
workSpace
!=
NULL
,
return
,
"The workspace is null"
);
PARAM_LOGI
(
"CloseWorkSpace %s"
,
workSpace
->
fileName
);
if
(
!
PARAM_TEST_FLAG
(
workSpace
->
flags
,
WORKSPACE_FLAGS_INIT
))
{
free
(
workSpace
);
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录