diff options
author | José Bollo <jose.bollo@iot.bzh> | 2018-01-31 17:15:27 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2018-01-31 17:17:16 +0100 |
commit | a3245aed48dca435b437089bc81353da352fc0ce (patch) | |
tree | 99b0751a499b20d5396ff8e98d02647cce93249e /src/afb-export.c | |
parent | 3535d4cb73628c720da1bf74627ded2aec6f2ca1 (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.c | 12 |
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) |