plugin: fix parsing libexec plugin output

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
Jo-Philipp Wich 2014-07-03 23:39:21 +02:00
parent 3c55504336
commit 7fd4564b8a

View file

@ -108,12 +108,9 @@ rpc_plugin_call_finish_cb(struct blob_buf *blob, int stat, void *priv)
{
if (c->obj)
{
if (json_object_get_type(c->obj) == json_type_object ||
json_object_get_type(c->obj) == json_type_array)
{
blobmsg_add_json_element(blob, NULL, c->obj);
if (json_object_get_type(c->obj) == json_type_object &&
blobmsg_add_object(blob, c->obj))
rv = UBUS_STATUS_OK;
}
json_object_put(c->obj);
}