X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubus.git;a=blobdiff_plain;f=ubusd_obj.c;h=d1e53f8fb4f5c3cebd56e8eb1e165afaca7f35e1;hp=15f43ad64e6e3c060843c61c8317bf933ed982a7;hb=cb1feedb5e1388d7aea8bddef1284690c590874f;hpb=f6a6b0d492900b7a087a8a89d11fa5b94f4c5cb5 diff --git a/ubusd_obj.c b/ubusd_obj.c index 15f43ad..d1e53f8 100644 --- a/ubusd_obj.c +++ b/ubusd_obj.c @@ -98,6 +98,7 @@ struct ubus_object *ubusd_create_object_internal(struct ubus_object_type *type, obj->type = type; INIT_LIST_HEAD(&obj->list); + INIT_LIST_HEAD(&obj->events); if (type) type->refcount++; @@ -114,7 +115,7 @@ struct ubus_object *ubusd_create_object(struct ubus_client *cl, struct blob_attr struct ubus_object_type *type = NULL; if (attr[UBUS_ATTR_OBJTYPE]) - type = ubus_get_obj_type(blob_get_int32(attr[UBUS_ATTR_OBJTYPE])); + type = ubus_get_obj_type(blob_get_u32(attr[UBUS_ATTR_OBJTYPE])); else if (attr[UBUS_ATTR_SIGNATURE]) type = ubus_create_obj_type(attr[UBUS_ATTR_SIGNATURE]); @@ -142,7 +143,6 @@ struct ubus_object *ubusd_create_object(struct ubus_client *cl, struct blob_attr obj->client = cl; list_add(&obj->list, &cl->objects); - INIT_LIST_HEAD(&obj->events); return obj;