From f65fb8baaba285f5ff4b02af111420ba4479f5d9 Mon Sep 17 00:00:00 2001 From: cbdev Date: Wed, 11 Dec 2019 23:02:22 +0100 Subject: Simplify plugin_start API --- backends/lua.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'backends/lua.c') diff --git a/backends/lua.c b/backends/lua.c index 40e6613..b165dd8 100644 --- a/backends/lua.c +++ b/backends/lua.c @@ -428,17 +428,10 @@ static int lua_handle(size_t num, managed_fd* fds){ return 0; } -static int lua_start(){ - size_t n, u, p; - instance** inst = NULL; +static int lua_start(size_t n, instance** inst){ + size_t u, p; lua_instance_data* data = NULL; - //fetch all defined instances - if(mm_backend_instances(BACKEND_NAME, &n, &inst)){ - fprintf(stderr, "Failed to fetch instance list\n"); - return 1; - } - //resolve channels to their handler functions for(u = 0; u < n; u++){ data = (lua_instance_data*) inst[u]->impl; @@ -457,8 +450,6 @@ static int lua_start(){ } } - free(inst); - #ifdef MMBACKEND_LUA_TIMERFD //register the timer with the core fprintf(stderr, "Lua backend registering 1 descriptor to core\n"); -- cgit v1.2.3