[PATCH] Lua: do not inject again bootenv for handlers

2 views
Skip to first unread message

Stefano Babic

unread,
9:08 AM (11 hours ago) 9:08 AM
to swup...@googlegroups.com, Stefano Babic
Boot environment is pushed to Lua stack to let it available to Lua
handlers. After moving Lua state to be per session and added the
environment whe nthe session is initialized, there is no need to do this
another time.

Signed-off-by: Stefano Babic <stefan...@swupdate.org>
---
corelib/lua_interface.c | 11 -----------
1 file changed, 11 deletions(-)

diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c
index 86c2112d..ffa3af8c 100644
--- a/corelib/lua_interface.c
+++ b/corelib/lua_interface.c
@@ -1307,17 +1307,6 @@ static int l_handler_wrapper(struct img_type *img, void *data,
return -1;
}

- if (img->bootloader) {
- lua_getglobal(L, "swupdate");
- if (!lua_istable(L, -1)) {
- ERROR("Lua stack corrupted.");
- return -1;
- }
- struct dict **udbootenv = lua_newuserdata(L, sizeof(struct dict*));
- *udbootenv = img->bootloader;
- lua_pop(L, 1);
- }
-
l_func_ref = *((int*)data);
/* get the callback function */
lua_rawgeti(L, LUA_REGISTRYINDEX, l_func_ref );
--
2.34.1

Reply all
Reply to author
Forward
0 new messages