mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Get Name Method: Several fixes
This commit is contained in:
parent
09d0adde8e
commit
eddef9c116
1 changed files with 7 additions and 6 deletions
|
|
@ -1506,7 +1506,7 @@ static int get_ubus_name(struct dmctx *dmctx, struct dmnode *node)
|
|||
|
||||
char *fault = dmjson_get_value(res_obj, 1, "fault");
|
||||
if (DM_STRLEN(fault))
|
||||
continue;
|
||||
return DM_STRTOUL(fault);
|
||||
|
||||
dmctx->findparam = 1;
|
||||
|
||||
|
|
@ -1521,6 +1521,9 @@ static int get_ubus_name(struct dmctx *dmctx, struct dmnode *node)
|
|||
if ((path[len - 1] == '.' && path_dot_num > in_path_dot_num + 1) ||
|
||||
(path[len - 1] != '.' && path_dot_num > in_path_dot_num))
|
||||
continue;
|
||||
} else {
|
||||
if (i == 0 && (dmctx->in_param[0] == '\0' || rootcmp(dmctx->in_param, "Device") == 0))
|
||||
continue;
|
||||
}
|
||||
|
||||
add_list_parameter(dmctx, dmstrdup(path), dmstrdup(data), dmstrdup(type), NULL);
|
||||
|
|
@ -1833,10 +1836,8 @@ static int mparam_get_name_in_param(DMPARAM_ARGS)
|
|||
{
|
||||
if (node->is_ubus_service) {
|
||||
int err = get_ubus_name(dmctx, node);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
dmctx->stop = true;
|
||||
return err ? err : 0;
|
||||
} else {
|
||||
char *refparam;
|
||||
char *perm = leaf->permission->val;
|
||||
|
|
@ -1868,9 +1869,8 @@ static int mparam_get_name_in_param(DMPARAM_ARGS)
|
|||
|
||||
add_list_parameter(dmctx, refparam, perm, DMT_TYPE[leaf->type], NULL);
|
||||
dmctx->findparam = (dmctx->iswildcard) ? 1 : 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mobj_get_name_in_obj(DMOBJECT_ARGS)
|
||||
|
|
@ -1947,6 +1947,7 @@ int dm_entry_get_name(struct dmctx *ctx)
|
|||
ctx->method_obj = mobj_get_name;
|
||||
ctx->method_param = mparam_get_name;
|
||||
ctx->in_param = root->obj;
|
||||
ctx->disable_mservice_browse = true;
|
||||
node.matched = 1;
|
||||
findparam_check = 1;
|
||||
} else if (*(ctx->in_param + len - 1) == '.') {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue