提交 1bd2f018 编写于 作者: X xionglei6

fix: 解决FindSystemParam错误

Signed-off-by: Nxionglei6 <xionglei6@huawei.com>
上级 58a8bbb3
......@@ -33,6 +33,7 @@
#include "init_cmds.h"
#include "init_log.h"
#include "init_jobs_internal.h"
#include "init_param.h"
#include "init_service.h"
#include "init_service_manager.h"
#include "init_service_socket.h"
......@@ -448,6 +449,7 @@ void ServiceReap(Service *service)
if (CalculateCrashTime(service, service->crashTime, service->crashCount) == false) {
INIT_LOGE("Critical service \" %s \" crashed %d times, rebooting system",
service->name, service->crashCount);
SystemWriteParam("startup.device.ctl", "stop");
ExecReboot("reboot");
}
} else if (!(service->attribute & SERVICE_ATTR_NEED_RESTART)) {
......
......@@ -114,9 +114,10 @@ int ReadParamWithCheck(const ParamWorkSpace *workSpace, const char *name, uint32
PARAM_CHECK(handle != NULL, return PARAM_CODE_INVALID_PARAM, "Invalid param handle");
PARAM_CHECK(workSpace != NULL && name != NULL, return PARAM_CODE_INVALID_PARAM, "Invalid param name");
*handle = -1;
#ifdef READ_CHECK
int ret = CheckParamPermission(workSpace, workSpace->securityLabel, name, op);
PARAM_CHECK(ret == 0, return ret, "Forbid to access parameter %s", name);
#endif
ParamTrieNode *node = FindTrieNode(&workSpace->paramSpace, name, strlen(name), NULL);
if (node != NULL && node->dataIndex != 0) {
*handle = node->dataIndex;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册