Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
cc8fc0f3
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
接近 2 年 前同步成功
通知
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看板
提交
cc8fc0f3
编写于
6月 17, 2022
作者:
W
Wen liumin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix spelling mistakes
Signed-off-by:
N
Wen liumin
<
904600657@qq.com
>
上级
dc6c151d
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
33 addition
and
33 deletion
+33
-33
initsync/include/init_stage.h
initsync/include/init_stage.h
+1
-1
interfaces/innerkits/control_fd/control_fd_client.c
interfaces/innerkits/control_fd/control_fd_client.c
+8
-8
interfaces/innerkits/fs_manager/fstab_mount.c
interfaces/innerkits/fs_manager/fstab_mount.c
+1
-1
interfaces/innerkits/init_module_engine/BUILD.gn
interfaces/innerkits/init_module_engine/BUILD.gn
+1
-1
interfaces/innerkits/sandbox/sandbox_namespace.c
interfaces/innerkits/sandbox/sandbox_namespace.c
+1
-1
interfaces/innerkits/service_control/service_control.c
interfaces/innerkits/service_control/service_control.c
+2
-2
services/etc/param/ohos.para.dac
services/etc/param/ohos.para.dac
+2
-2
services/include/list.h
services/include/list.h
+3
-3
services/init/lite/init_jobs.c
services/init/lite/init_jobs.c
+2
-2
services/init/standard/init_mount.c
services/init/standard/init_mount.c
+2
-2
services/modules/bootchart/bootchart.c
services/modules/bootchart/bootchart.c
+1
-1
services/param/manager/param_manager.c
services/param/manager/param_manager.c
+2
-2
services/param/trigger/trigger_manager.c
services/param/trigger/trigger_manager.c
+6
-6
services/utils/list.c
services/utils/list.c
+1
-1
未找到文件。
initsync/include/init_stage.h
浏览文件 @
cc8fc0f3
...
@@ -51,7 +51,7 @@ typedef struct {
...
@@ -51,7 +51,7 @@ typedef struct {
#define QUICKSTART_NODE "/dev/quickstart"
#define QUICKSTART_NODE "/dev/quickstart"
/* Simple sample Us
e
age:
/* Simple sample Usage:
* INIT PROCESS
* INIT PROCESS
* SystemInitStage(QS_STAGE1)----(1)fork----> key APP
* SystemInitStage(QS_STAGE1)----(1)fork----> key APP
* |(2) |(3)
* |(2) |(3)
...
...
interfaces/innerkits/control_fd/control_fd_client.c
浏览文件 @
cc8fc0f3
...
@@ -38,7 +38,7 @@ static int g_FifoWriteFd = -1;
...
@@ -38,7 +38,7 @@ static int g_FifoWriteFd = -1;
static
void
ProcessFifoWrite
(
const
WatcherHandle
taskHandle
,
int
fd
,
uint32_t
*
events
,
const
void
*
context
)
static
void
ProcessFifoWrite
(
const
WatcherHandle
taskHandle
,
int
fd
,
uint32_t
*
events
,
const
void
*
context
)
{
{
if
((
fd
<
0
)
||
(
events
==
NULL
)
||
(
context
==
NULL
))
{
if
((
fd
<
0
)
||
(
events
==
NULL
)
||
(
context
==
NULL
))
{
BEGET_LOGE
(
"[control_fd] Inva
il
d fifo write parameter"
);
BEGET_LOGE
(
"[control_fd] Inva
li
d fifo write parameter"
);
return
;
return
;
}
}
int
fifow
=
*
((
int
*
)
context
);
int
fifow
=
*
((
int
*
)
context
);
...
@@ -63,7 +63,7 @@ static void ProcessFifoWrite(const WatcherHandle taskHandle, int fd, uint32_t *e
...
@@ -63,7 +63,7 @@ static void ProcessFifoWrite(const WatcherHandle taskHandle, int fd, uint32_t *e
static
void
ProcessFifoRead
(
const
WatcherHandle
taskHandle
,
int
fd
,
uint32_t
*
events
,
const
void
*
context
)
static
void
ProcessFifoRead
(
const
WatcherHandle
taskHandle
,
int
fd
,
uint32_t
*
events
,
const
void
*
context
)
{
{
if
((
fd
<
0
)
||
(
events
==
NULL
))
{
if
((
fd
<
0
)
||
(
events
==
NULL
))
{
BEGET_LOGE
(
"[control_fd] Inva
il
d fifo read parameter"
);
BEGET_LOGE
(
"[control_fd] Inva
li
d fifo read parameter"
);
return
;
return
;
}
}
char
buf
[
FIFO_BUF_SIZE
]
=
{
0
};
char
buf
[
FIFO_BUF_SIZE
]
=
{
0
};
...
@@ -123,7 +123,7 @@ static void CmdDisConnectComplete(const TaskHandle client)
...
@@ -123,7 +123,7 @@ static void CmdDisConnectComplete(const TaskHandle client)
static
void
CmdAgentInit
(
WatcherHandle
handle
,
const
char
*
path
,
bool
read
,
ProcessWatchEvent
func
)
static
void
CmdAgentInit
(
WatcherHandle
handle
,
const
char
*
path
,
bool
read
,
ProcessWatchEvent
func
)
{
{
if
(
path
==
NULL
)
{
if
(
path
==
NULL
)
{
BEGET_LOGE
(
"[control_fd] Inva
il
d parameter"
);
BEGET_LOGE
(
"[control_fd] Inva
li
d parameter"
);
return
;
return
;
}
}
BEGET_LOGI
(
"[control_fd] client open %s"
,
(
read
?
"read"
:
"write"
));
BEGET_LOGI
(
"[control_fd] client open %s"
,
(
read
?
"read"
:
"write"
));
...
@@ -173,7 +173,7 @@ static void CmdOnSendMessageComplete(const TaskHandle task, const BufferHandle h
...
@@ -173,7 +173,7 @@ static void CmdOnSendMessageComplete(const TaskHandle task, const BufferHandle h
static
CmdAgent
*
CmdAgentCreate
(
const
char
*
server
)
static
CmdAgent
*
CmdAgentCreate
(
const
char
*
server
)
{
{
if
(
server
==
NULL
)
{
if
(
server
==
NULL
)
{
BEGET_LOGE
(
"[control_fd] Inva
il
d parameter"
);
BEGET_LOGE
(
"[control_fd] Inva
li
d parameter"
);
return
NULL
;
return
NULL
;
}
}
TaskHandle
task
=
NULL
;
TaskHandle
task
=
NULL
;
...
@@ -197,7 +197,7 @@ static CmdAgent *CmdAgentCreate(const char *server)
...
@@ -197,7 +197,7 @@ static CmdAgent *CmdAgentCreate(const char *server)
static
int
CreateFifo
(
const
char
*
pipeName
)
static
int
CreateFifo
(
const
char
*
pipeName
)
{
{
if
(
pipeName
==
NULL
)
{
if
(
pipeName
==
NULL
)
{
BEGET_LOGE
(
"[control_fd] Inva
il
d parameter"
);
BEGET_LOGE
(
"[control_fd] Inva
li
d parameter"
);
return
-
1
;
return
-
1
;
}
}
// create fifo for cmd
// create fifo for cmd
...
@@ -214,7 +214,7 @@ static int CreateFifo(const char *pipeName)
...
@@ -214,7 +214,7 @@ static int CreateFifo(const char *pipeName)
static
int
SendCmdMessage
(
const
CmdAgent
*
agent
,
uint16_t
type
,
const
char
*
cmd
,
const
char
*
fifoName
)
static
int
SendCmdMessage
(
const
CmdAgent
*
agent
,
uint16_t
type
,
const
char
*
cmd
,
const
char
*
fifoName
)
{
{
if
((
agent
==
NULL
)
||
(
cmd
==
NULL
)
||
(
fifoName
==
NULL
))
{
if
((
agent
==
NULL
)
||
(
cmd
==
NULL
)
||
(
fifoName
==
NULL
))
{
BEGET_LOGE
(
"[control_fd] Inva
il
d parameter"
);
BEGET_LOGE
(
"[control_fd] Inva
li
d parameter"
);
return
-
1
;
return
-
1
;
}
}
int
ret
=
0
;
int
ret
=
0
;
...
@@ -242,7 +242,7 @@ static int SendCmdMessage(const CmdAgent *agent, uint16_t type, const char *cmd,
...
@@ -242,7 +242,7 @@ static int SendCmdMessage(const CmdAgent *agent, uint16_t type, const char *cmd,
static
int
CmdMakeFifoInit
(
const
char
*
fifoPath
)
static
int
CmdMakeFifoInit
(
const
char
*
fifoPath
)
{
{
if
(
fifoPath
==
NULL
)
{
if
(
fifoPath
==
NULL
)
{
BEGET_LOGE
(
"[control_fd] Inva
il
d parameter"
);
BEGET_LOGE
(
"[control_fd] Inva
li
d parameter"
);
return
-
1
;
return
-
1
;
}
}
int
ret
=
sprintf_s
(
g_FifoReadPath
,
sizeof
(
g_FifoReadPath
)
-
1
,
"/dev/fifo/%s0.%d"
,
fifoPath
,
getpid
());
int
ret
=
sprintf_s
(
g_FifoReadPath
,
sizeof
(
g_FifoReadPath
)
-
1
,
"/dev/fifo/%s0.%d"
,
fifoPath
,
getpid
());
...
@@ -260,7 +260,7 @@ static int CmdMakeFifoInit(const char *fifoPath)
...
@@ -260,7 +260,7 @@ static int CmdMakeFifoInit(const char *fifoPath)
void
CmdClientInit
(
const
char
*
socketPath
,
uint16_t
type
,
const
char
*
cmd
,
const
char
*
fifoName
)
void
CmdClientInit
(
const
char
*
socketPath
,
uint16_t
type
,
const
char
*
cmd
,
const
char
*
fifoName
)
{
{
if
((
socketPath
==
NULL
)
||
(
cmd
==
NULL
))
{
if
((
socketPath
==
NULL
)
||
(
cmd
==
NULL
))
{
BEGET_LOGE
(
"[control_fd] Inva
il
d parameter"
);
BEGET_LOGE
(
"[control_fd] Inva
li
d parameter"
);
}
}
BEGET_LOGI
(
"[control_fd] CmdAgentInit"
);
BEGET_LOGI
(
"[control_fd] CmdAgentInit"
);
int
ret
=
CmdMakeFifoInit
(
fifoName
);
int
ret
=
CmdMakeFifoInit
(
fifoName
);
...
...
interfaces/innerkits/fs_manager/fstab_mount.c
浏览文件 @
cc8fc0f3
...
@@ -256,7 +256,7 @@ static int Mount(const char *source, const char *target, const char *fsType,
...
@@ -256,7 +256,7 @@ static int Mount(const char *source, const char *target, const char *fsType,
int
rc
=
-
1
;
int
rc
=
-
1
;
if
(
source
==
NULL
||
target
==
NULL
||
fsType
==
NULL
)
{
if
(
source
==
NULL
||
target
==
NULL
||
fsType
==
NULL
)
{
BEGET_LOGE
(
"Invalid argment for mount."
);
BEGET_LOGE
(
"Invalid arg
u
ment for mount."
);
return
-
1
;
return
-
1
;
}
}
if
(
stat
(
target
,
&
st
)
!=
0
&&
errno
!=
ENOENT
)
{
if
(
stat
(
target
,
&
st
)
!=
0
&&
errno
!=
ENOENT
)
{
...
...
interfaces/innerkits/init_module_engine/BUILD.gn
浏览文件 @
cc8fc0f3
...
@@ -28,7 +28,7 @@ config("init_module_engine_exported_config") {
...
@@ -28,7 +28,7 @@ config("init_module_engine_exported_config") {
}
}
#
#
# innerkits for module develop
e
ment
# innerkits for module development
#
#
ohos_native_stub_library("libinit_module_engine") {
ohos_native_stub_library("libinit_module_engine") {
output_extension = "so"
output_extension = "so"
...
...
interfaces/innerkits/sandbox/sandbox_namespace.c
浏览文件 @
cc8fc0f3
...
@@ -52,7 +52,7 @@ int UnshareNamespace(int nsType)
...
@@ -52,7 +52,7 @@ int UnshareNamespace(int nsType)
int
SetNamespace
(
int
nsFd
,
int
nsType
)
int
SetNamespace
(
int
nsFd
,
int
nsType
)
{
{
if
(
nsFd
<
0
)
{
if
(
nsFd
<
0
)
{
BEGET_LOGE
(
"Namespace fd is inva
il
d"
);
BEGET_LOGE
(
"Namespace fd is inva
li
d"
);
return
-
1
;
return
-
1
;
}
}
if
(
nsType
!=
CLONE_NEWNS
)
{
if
(
nsType
!=
CLONE_NEWNS
)
{
...
...
interfaces/innerkits/service_control/service_control.c
浏览文件 @
cc8fc0f3
...
@@ -228,7 +228,7 @@ int ServiceSetReady(const char *serviceName)
...
@@ -228,7 +228,7 @@ int ServiceSetReady(const char *serviceName)
int
StartServiceByTimer
(
const
char
*
serviceName
,
uint64_t
timeout
)
int
StartServiceByTimer
(
const
char
*
serviceName
,
uint64_t
timeout
)
{
{
if
(
serviceName
==
NULL
)
{
if
(
serviceName
==
NULL
)
{
BEGET_LOGE
(
"Request start ser
iv
ce by timer with invalid service name"
);
BEGET_LOGE
(
"Request start ser
vi
ce by timer with invalid service name"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -253,7 +253,7 @@ int StartServiceByTimer(const char *serviceName, uint64_t timeout)
...
@@ -253,7 +253,7 @@ int StartServiceByTimer(const char *serviceName, uint64_t timeout)
int
StopServiceTimer
(
const
char
*
serviceName
)
int
StopServiceTimer
(
const
char
*
serviceName
)
{
{
if
(
serviceName
==
NULL
)
{
if
(
serviceName
==
NULL
)
{
BEGET_LOGE
(
"Request stop ser
iv
ce timer with invalid service name"
);
BEGET_LOGE
(
"Request stop ser
vi
ce timer with invalid service name"
);
return
-
1
;
return
-
1
;
}
}
...
...
services/etc/param/ohos.para.dac
浏览文件 @
cc8fc0f3
...
@@ -25,7 +25,7 @@ const.allow.mock.location = root:root:0777
...
@@ -25,7 +25,7 @@ const.allow.mock.location = root:root:0777
const.debuggable = root:root:0777
const.debuggable = root:root:0777
persist.sys.usb.config = root:root:0777
persist.sys.usb.config = root:root:0777
# default forbi
t
other user to start service
# default forbi
d
other user to start service
ohos.servicectrl. = system:servicectrl:0775
ohos.servicectrl. = system:servicectrl:0775
ohos.startup.powerctrl. = system:powerctrl:0775
ohos.startup.powerctrl. = system:powerctrl:0775
ohos.boot. = system:bootctrl:0775
ohos.boot. = system:bootctrl:0775
...
@@ -36,4 +36,4 @@ persist.window.boot. = root:system:0775
...
@@ -36,4 +36,4 @@ persist.window.boot. = root:system:0775
#permission for log
#permission for log
debug.bytrace. = root:system:0775
debug.bytrace. = root:system:0775
persist.distributed_hardware.device_manager. = system:system:0775
persist.distributed_hardware.device_manager. = system:system:0775
\ No newline at end of file
services/include/list.h
浏览文件 @
cc8fc0f3
...
@@ -79,7 +79,7 @@ void ListAddTail(struct ListNode *list, struct ListNode *item);
...
@@ -79,7 +79,7 @@ void ListAddTail(struct ListNode *list, struct ListNode *item);
void
ListRemove
(
struct
ListNode
*
item
);
void
ListRemove
(
struct
ListNode
*
item
);
/**
/**
* @brief ListNode comparis
i
on function prototype
* @brief ListNode comparison function prototype
*
*
* @param node ListNode to be compared.
* @param node ListNode to be compared.
* @param newNode new ListNode to be compared.
* @param newNode new ListNode to be compared.
...
@@ -132,9 +132,9 @@ ListNode *ListFind(const ListNode *head, void *data, ListTraversalProc comparePr
...
@@ -132,9 +132,9 @@ ListNode *ListFind(const ListNode *head, void *data, ListTraversalProc comparePr
* @brief Traversal the list with specified function
* @brief Traversal the list with specified function
*
*
* @param head list head, make sure head is valid pointer.
* @param head list head, make sure head is valid pointer.
* @param cookie optinal traversing data.
* @param cookie opti
o
nal traversing data.
* @param traversalProc comparing function, return 0 if matched.
* @param traversalProc comparing function, return 0 if matched.
* @param flags optinal traversing flags:
* @param flags opti
o
nal traversing flags:
* TRAVERSE_REVERSE_ORDER: traversing from last node to first node;
* TRAVERSE_REVERSE_ORDER: traversing from last node to first node;
* default behaviour is from first node to last node
* default behaviour is from first node to last node
* TRAVERSE_STOP_WHEN_ERROR: stop traversing if traversalProc return non-zero
* TRAVERSE_STOP_WHEN_ERROR: stop traversing if traversalProc return non-zero
...
...
services/init/lite/init_jobs.c
浏览文件 @
cc8fc0f3
...
@@ -70,12 +70,12 @@ static void ParseJob(const cJSON *jobItem, Job *resJob)
...
@@ -70,12 +70,12 @@ static void ParseJob(const cJSON *jobItem, Job *resJob)
cJSON
*
cmdsItem
=
cJSON_GetObjectItem
(
jobItem
,
CMDS_ARR_NAME_IN_JSON
);
cJSON
*
cmdsItem
=
cJSON_GetObjectItem
(
jobItem
,
CMDS_ARR_NAME_IN_JSON
);
if
(
!
cJSON_IsArray
(
cmdsItem
))
{
if
(
!
cJSON_IsArray
(
cmdsItem
))
{
INIT_LOGE
(
"job %s is not an arra
r
y"
,
resJob
->
name
);
INIT_LOGE
(
"job %s is not an array"
,
resJob
->
name
);
return
;
return
;
}
}
int
ret
=
GetCmdLinesFromJson
(
cmdsItem
,
&
resJob
->
cmdLines
);
int
ret
=
GetCmdLinesFromJson
(
cmdsItem
,
&
resJob
->
cmdLines
);
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
{
INIT_LOGE
(
"ParseJob, faild to get cmds for job!"
);
INIT_LOGE
(
"ParseJob, fail
e
d to get cmds for job!"
);
return
;
return
;
}
}
return
;
return
;
...
...
services/init/standard/init_mount.c
浏览文件 @
cc8fc0f3
...
@@ -55,10 +55,10 @@ static int ParseRequiredMountInfo(const char *item, Fstab *fstab)
...
@@ -55,10 +55,10 @@ static int ParseRequiredMountInfo(const char *item, Fstab *fstab)
q
=
item
+
strlen
(
OHOS_REQUIRED_MOUNT_PREFIX
);
// Get partition name
q
=
item
+
strlen
(
OHOS_REQUIRED_MOUNT_PREFIX
);
// Get partition name
INIT_CHECK
(
!
(
q
==
NULL
||
*
q
==
'\0'
||
(
p
-
q
)
<=
0
),
return
-
1
);
INIT_CHECK
(
!
(
q
==
NULL
||
*
q
==
'\0'
||
(
p
-
q
)
<=
0
),
return
-
1
);
INIT_ERROR_CHECK
(
strncpy_s
(
partName
,
PARTITION_NAME_SIZE
-
1
,
q
,
p
-
q
)
==
EOK
,
INIT_ERROR_CHECK
(
strncpy_s
(
partName
,
PARTITION_NAME_SIZE
-
1
,
q
,
p
-
q
)
==
EOK
,
return
-
1
,
"Failed to copy requ
ri
ed partition name"
);
return
-
1
,
"Failed to copy requ
ir
ed partition name"
);
p
++
;
// skip '='
p
++
;
// skip '='
INIT_ERROR_CHECK
(
strncpy_s
(
mountOptions
,
MAX_BUFFER_LEN
-
1
,
p
,
strlen
(
p
))
==
EOK
,
INIT_ERROR_CHECK
(
strncpy_s
(
mountOptions
,
MAX_BUFFER_LEN
-
1
,
p
,
strlen
(
p
))
==
EOK
,
return
-
1
,
"Failed to copy requ
ri
ed mount info: %s"
,
item
);
return
-
1
,
"Failed to copy requ
ir
ed mount info: %s"
,
item
);
}
}
INIT_LOGV
(
"Mount option of partition %s is [%s]"
,
partName
,
mountOptions
);
INIT_LOGV
(
"Mount option of partition %s is [%s]"
,
partName
,
mountOptions
);
if
(
ParseFstabPerLine
(
mountOptions
,
fstab
,
false
,
"@"
)
<
0
)
{
if
(
ParseFstabPerLine
(
mountOptions
,
fstab
,
false
,
"@"
)
<
0
)
{
...
...
services/modules/bootchart/bootchart.c
浏览文件 @
cc8fc0f3
...
@@ -260,7 +260,7 @@ static int DoBootchartStop(void)
...
@@ -260,7 +260,7 @@ static int DoBootchartStop(void)
pthread_mutex_unlock
(
&
(
g_bootchartCtrl
->
mutex
));
pthread_mutex_unlock
(
&
(
g_bootchartCtrl
->
mutex
));
pthread_join
(
g_bootchartCtrl
->
threadId
,
NULL
);
pthread_join
(
g_bootchartCtrl
->
threadId
,
NULL
);
BootchartDestory
();
BootchartDestory
();
PLUGIN_LOGI
(
"bootcharting stoped"
);
PLUGIN_LOGI
(
"bootcharting stop
p
ed"
);
return
0
;
return
0
;
}
}
...
...
services/param/manager/param_manager.c
浏览文件 @
cc8fc0f3
...
@@ -171,7 +171,7 @@ void SystemDumpParameters(int verbose)
...
@@ -171,7 +171,7 @@ void SystemDumpParameters(int verbose)
if
(
ret
!=
PARAM_CODE_NOT_FOUND
&&
ret
!=
0
&&
ret
!=
PARAM_CODE_NODE_EXIST
)
{
if
(
ret
!=
PARAM_CODE_NOT_FOUND
&&
ret
!=
0
&&
ret
!=
PARAM_CODE_NODE_EXIST
)
{
PARAM_CHECK
(
ret
==
0
,
return
,
"Forbid to dump parameters"
);
PARAM_CHECK
(
ret
==
0
,
return
,
"Forbid to dump parameters"
);
}
}
PARAM_DUMP
(
"Dump all paramters begin ...
\n
"
);
PARAM_DUMP
(
"Dump all param
e
ters begin ...
\n
"
);
if
(
verbose
)
{
if
(
verbose
)
{
PARAM_DUMP
(
"Local sercurity information
\n
"
);
PARAM_DUMP
(
"Local sercurity information
\n
"
);
PARAM_DUMP
(
"
\t
pid: %d uid: %d gid: %d
\n
"
,
PARAM_DUMP
(
"
\t
pid: %d uid: %d gid: %d
\n
"
,
...
@@ -185,7 +185,7 @@ void SystemDumpParameters(int verbose)
...
@@ -185,7 +185,7 @@ void SystemDumpParameters(int verbose)
HashNodeTraverseForDump
(
workSpace
,
verbose
);
HashNodeTraverseForDump
(
workSpace
,
verbose
);
workSpace
=
next
;
workSpace
=
next
;
}
}
PARAM_DUMP
(
"Dump all paramters finish
\n
"
);
PARAM_DUMP
(
"Dump all param
e
ters finish
\n
"
);
}
}
INIT_INNER_API
int
SysCheckParamExist
(
const
char
*
name
)
INIT_INNER_API
int
SysCheckParamExist
(
const
char
*
name
)
...
...
services/param/trigger/trigger_manager.c
浏览文件 @
cc8fc0f3
...
@@ -403,16 +403,16 @@ static int ExecTriggerMatch_(const TriggerWorkSpace *workSpace,
...
@@ -403,16 +403,16 @@ static int ExecTriggerMatch_(const TriggerWorkSpace *workSpace,
static
int
CheckBootMatch_
(
const
TriggerWorkSpace
*
workSpace
,
static
int
CheckBootMatch_
(
const
TriggerWorkSpace
*
workSpace
,
int
type
,
LogicCalculator
*
calculator
,
const
char
*
content
,
uint32_t
contentSize
)
int
type
,
LogicCalculator
*
calculator
,
const
char
*
content
,
uint32_t
contentSize
)
{
{
PARAM_CHECK
(
workSpace
!=
NULL
,
return
-
1
,
"Invaid space"
);
PARAM_CHECK
(
workSpace
!=
NULL
,
return
-
1
,
"Inva
l
id space"
);
PARAM_CHECK
((
type
==
TRIGGER_BOOT
)
||
(
type
==
TRIGGER_PARAM_WATCH
),
return
-
1
,
"Invaid type"
);
PARAM_CHECK
((
type
==
TRIGGER_BOOT
)
||
(
type
==
TRIGGER_PARAM_WATCH
),
return
-
1
,
"Inva
l
id type"
);
return
ExecTriggerMatch_
(
workSpace
,
type
,
calculator
,
content
,
contentSize
);
return
ExecTriggerMatch_
(
workSpace
,
type
,
calculator
,
content
,
contentSize
);
}
}
static
int
CheckParamMatch_
(
const
TriggerWorkSpace
*
workSpace
,
static
int
CheckParamMatch_
(
const
TriggerWorkSpace
*
workSpace
,
int
type
,
LogicCalculator
*
calculator
,
const
char
*
content
,
uint32_t
contentSize
)
int
type
,
LogicCalculator
*
calculator
,
const
char
*
content
,
uint32_t
contentSize
)
{
{
PARAM_CHECK
(
workSpace
!=
NULL
,
return
-
1
,
"Invaid space"
);
PARAM_CHECK
(
workSpace
!=
NULL
,
return
-
1
,
"Inva
l
id space"
);
PARAM_CHECK
((
type
==
TRIGGER_PARAM
)
||
(
type
==
TRIGGER_PARAM_WAIT
),
return
-
1
,
"Invaid type"
);
PARAM_CHECK
((
type
==
TRIGGER_PARAM
)
||
(
type
==
TRIGGER_PARAM_WAIT
),
return
-
1
,
"Inva
l
id type"
);
CalculatorInit
(
calculator
,
MAX_CONDITION_NUMBER
,
sizeof
(
LogicData
),
1
);
CalculatorInit
(
calculator
,
MAX_CONDITION_NUMBER
,
sizeof
(
LogicData
),
1
);
int
ret
=
GetValueFromContent
(
content
,
contentSize
,
0
,
calculator
->
inputName
,
SUPPORT_DATA_BUFFER_MAX
);
int
ret
=
GetValueFromContent
(
content
,
contentSize
,
0
,
calculator
->
inputName
,
SUPPORT_DATA_BUFFER_MAX
);
...
@@ -427,7 +427,7 @@ static int CheckUnknowMatch_(const TriggerWorkSpace *workSpace,
...
@@ -427,7 +427,7 @@ static int CheckUnknowMatch_(const TriggerWorkSpace *workSpace,
int
type
,
LogicCalculator
*
calculator
,
const
char
*
content
,
uint32_t
contentSize
)
int
type
,
LogicCalculator
*
calculator
,
const
char
*
content
,
uint32_t
contentSize
)
{
{
PARAM_CHECK
(
workSpace
!=
NULL
&&
content
!=
NULL
,
return
-
1
,
"Failed arg for trigger"
);
PARAM_CHECK
(
workSpace
!=
NULL
&&
content
!=
NULL
,
return
-
1
,
"Failed arg for trigger"
);
PARAM_CHECK
(
type
==
TRIGGER_UNKNOW
,
return
-
1
,
"Invaid type"
);
PARAM_CHECK
(
type
==
TRIGGER_UNKNOW
,
return
-
1
,
"Inva
l
id type"
);
CalculatorInit
(
calculator
,
MAX_CONDITION_NUMBER
,
sizeof
(
LogicData
),
1
);
CalculatorInit
(
calculator
,
MAX_CONDITION_NUMBER
,
sizeof
(
LogicData
),
1
);
int
ret
=
memcpy_s
(
calculator
->
triggerContent
,
sizeof
(
calculator
->
triggerContent
),
content
,
contentSize
);
int
ret
=
memcpy_s
(
calculator
->
triggerContent
,
sizeof
(
calculator
->
triggerContent
),
content
,
contentSize
);
...
@@ -760,4 +760,4 @@ const char *GetTriggerName(const TriggerNode *trigger)
...
@@ -760,4 +760,4 @@ const char *GetTriggerName(const TriggerNode *trigger)
return
triggerHead
->
getTriggerName
(
trigger
);
return
triggerHead
->
getTriggerName
(
trigger
);
}
}
return
""
;
return
""
;
}
}
\ No newline at end of file
services/utils/list.c
浏览文件 @
cc8fc0f3
...
@@ -142,7 +142,7 @@ ListNode *ListFind(const ListNode *head, void *data, ListTraversalProc comparePr
...
@@ -142,7 +142,7 @@ ListNode *ListFind(const ListNode *head, void *data, ListTraversalProc comparePr
* @brief Traversal the list with specified function
* @brief Traversal the list with specified function
*
*
* @param head list head, make sure head is valid pointer.
* @param head list head, make sure head is valid pointer.
* @param cookie optinal traversing data.
* @param cookie opti
o
nal traversing data.
* @param traversalProc comparing function, return 0 if matched.
* @param traversalProc comparing function, return 0 if matched.
* @param flags optinal traversing flags:
* @param flags optinal traversing flags:
* TRAVERSE_REVERSE_ORDER: traversing from last node to first node;
* TRAVERSE_REVERSE_ORDER: traversing from last node to first node;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录