|
@@ -1735,7 +1735,7 @@ static int shell_ini__load_sysevent(sp_cfg_shell_ini_t* shell, const char* shell
|
|
|
sysevent->arr_owner_entity = shm_array_make(0, sizeof(sp_cfg_shell_entity_t*));
|
|
|
int ret = sscanf(it->second.c_str(), "%[^,], \"%[^\"]", tmp, sysevent->init_value);
|
|
|
|
|
|
- auto varRet = inifile_format_read(shell_var_path, "SysEvent", sysevent->name, "%[^,], \"%[^\"]", tmp2, initVar);
|
|
|
+ auto varRet = inifile_format_read(shell_var_path, SHELL_SYSEVENT_HEAD, sysevent->name, "%[^,], \"%[^\"]", tmp2, initVar);
|
|
|
if (varRet == 2) {
|
|
|
/** 缺陷修复,以shell.ini的实体内容为准 Gifur@2023426]*/
|
|
|
/**TODO(Gifur): BUG: 如果在已有的系统变量上添加已有的实体,会因运行时存在文件而导致添加失败 [5/23/2020 Gifur] */
|
|
@@ -1750,6 +1750,14 @@ static int shell_ini__load_sysevent(sp_cfg_shell_ini_t* shell, const char* shell
|
|
|
strcpy(sysevent->init_value, "I");
|
|
|
|
|
|
if (ret > 0) {
|
|
|
+ sp_cfg_shell_entity_t* shell_entity = find_entity(shell, SPSHELL_NAME);
|
|
|
+ if (shell_entity) {
|
|
|
+ SHM_ARRAY_PUSH(sysevent->arr_owner_entity, sp_cfg_shell_entity_t*) = shell_entity;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("cannot find entity %s", SPSHELL_NAME);
|
|
|
+ }
|
|
|
+
|
|
|
const char* seps = ";\t ";
|
|
|
char* tok = strtok(tmp, seps);
|
|
|
while (tok) {
|
|
@@ -1759,9 +1767,6 @@ static int shell_ini__load_sysevent(sp_cfg_shell_ini_t* shell, const char* shell
|
|
|
}
|
|
|
else {
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("cannot find entity %s", tok);
|
|
|
- rc = Error_NotExist;
|
|
|
- destroy_sysevent(sysevent);
|
|
|
- break;
|
|
|
}
|
|
|
tok = strtok(NULL, seps);
|
|
|
}
|