projects
/
project
/
ubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e49b34f
)
add support for a const void * key in avl
author
Felix Fietkau
<nbd@openwrt.org>
Wed, 13 Apr 2011 18:13:42 +0000
(20:13 +0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Wed, 13 Apr 2011 18:13:42 +0000
(20:13 +0200)
ubusd_event.c
patch
|
blob
|
history
ubusd_obj.c
patch
|
blob
|
history
diff --git
a/ubusd_event.c
b/ubusd_event.c
index
87213b3
..
d12bcb8
100644
(file)
--- a/
ubusd_event.c
+++ b/
ubusd_event.c
@@
-46,7
+46,7
@@
static int ubusd_alloc_event_pattern(struct ubus_client *cl, struct blob_attr *m
struct event_source *ev;
struct ubus_object *obj;
struct blob_attr *attr[EVREG_LAST];
struct event_source *ev;
struct ubus_object *obj;
struct blob_attr *attr[EVREG_LAST];
- char *pattern;
+ char *pattern
, *name
;
uint32_t id;
bool partial = false;
int len;
uint32_t id;
bool partial = false;
int len;
@@
-82,8
+82,9
@@
static int ubusd_alloc_event_pattern(struct ubus_client *cl, struct blob_attr *m
list_add(&ev->list, &obj->events);
ev->obj = obj;
ev->partial = partial;
list_add(&ev->list, &obj->events);
ev->obj = obj;
ev->partial = partial;
- ev->avl.key = (void *) (ev + 1);
- strcpy(ev->avl.key, pattern);
+ name = (char *) (ev + 1);
+ strcpy(name, pattern);
+ ev->avl.key = name;
avl_insert(&patterns, &ev->avl);
return 0;
avl_insert(&patterns, &ev->avl);
return 0;
diff --git
a/ubusd_obj.c
b/ubusd_obj.c
index
3dd2d7f
..
3c0e823
100644
(file)
--- a/
ubusd_obj.c
+++ b/
ubusd_obj.c
@@
-135,7
+135,7
@@
struct ubus_object *ubusd_create_object(struct ubus_client *cl, struct blob_attr
goto free;
if (avl_insert(&path, &obj->path) != 0) {
goto free;
if (avl_insert(&path, &obj->path) != 0) {
- free(obj->path.key);
+ free(
(void *)
obj->path.key);
obj->path.key = NULL;
goto free;
}
obj->path.key = NULL;
goto free;
}
@@
-158,7
+158,7
@@
void ubusd_free_object(struct ubus_object *obj)
if (obj->path.key) {
ubusd_send_obj_event(obj, false);
avl_delete(&path, &obj->path);
if (obj->path.key) {
ubusd_send_obj_event(obj, false);
avl_delete(&path, &obj->path);
- free(obj->path.key);
+ free(
(void *)
obj->path.key);
}
if (!list_empty(&obj->list))
list_del(&obj->list);
}
if (!list_empty(&obj->list))
list_del(&obj->list);