aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-export.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-01-31 17:15:27 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2018-01-31 17:17:16 +0100
commita3245aed48dca435b437089bc81353da352fc0ce (patch)
tree99b0751a499b20d5396ff8e98d02647cce93249e /src/afb-export.c
parent3535d4cb73628c720da1bf74627ded2aec6f2ca1 (diff)
afb-evt: Add event creation with prefix
Change-Id: I2fd35e8ed59c28f4283be698a2586cdae5f7c8cf Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-export.c')
-rw-r--r--src/afb-export.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/afb-export.c b/src/afb-export.c
index 98964bf9..840bd919 100644
--- a/src/afb-export.c
+++ b/src/afb-export.c
@@ -153,8 +153,6 @@ static void old_vverbose_cb(void *closure, int level, const char *file, int line
static struct afb_eventid *eventid_make_cb(void *closure, const char *name)
{
- size_t plen, nlen;
- char *event;
struct afb_export *export = closure;
/* check daemon state */
@@ -164,16 +162,8 @@ static struct afb_eventid *eventid_make_cb(void *closure, const char *name)
return NULL;
}
- /* makes the event name */
- plen = strlen(export->apiname);
- nlen = strlen(name);
- event = alloca(nlen + plen + 2);
- memcpy(event, export->apiname, plen);
- event[plen] = '/';
- memcpy(event + plen + 1, name, nlen + 1);
-
/* create the event */
- return afb_evt_eventid_create(event);
+ return afb_evt_eventid_create2(export->apiname, name);
}
static struct afb_event event_make_cb(void *closure, const char *name)