summaryrefslogtreecommitdiff
path: root/ubusd_event.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-04-13 20:13:42 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-04-13 20:13:42 +0200
commit74eddc472d8c647f21a475bbe780b4509636ae35 (patch)
tree43d44abea2ab43739dd545c672656e1b6682e147 /ubusd_event.c
parente49b34f91267449e89d3f482b7c16bbf84bf90fd (diff)
downloadubus-74eddc472d8c647f21a475bbe780b4509636ae35.tar.gz
add support for a const void * key in avl
Diffstat (limited to 'ubusd_event.c')
-rw-r--r--ubusd_event.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ubusd_event.c b/ubusd_event.c
index 87213b3..d12bcb8 100644
--- 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];
- char *pattern;
+ char *pattern, *name;
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;
- 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;