lib: Adopt Lua stuff for Lua 5.4

lua_pcall() returns LUA_ERRGCMM in 5.3 which is already deprecated.

The constant LUA_ERRGCMM was removed.
Errors in finalizers are never propagated; instead, they generate a warning.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2025-01-09 09:48:27 +02:00
parent 708f2ca620
commit a39aa3eb37

View file

@ -248,10 +248,12 @@ int _frrscript_call_lua(struct lua_function_state *lfs, int nargs)
zlog_err("Lua hook call '%s' : error handler error: %s", zlog_err("Lua hook call '%s' : error handler error: %s",
lfs->name, lua_tostring(lfs->L, -1)); lfs->name, lua_tostring(lfs->L, -1));
break; break;
#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM <= 503
case LUA_ERRGCMM: case LUA_ERRGCMM:
zlog_err("Lua hook call '%s' : garbage collector error: %s", zlog_err("Lua hook call '%s' : garbage collector error: %s",
lfs->name, lua_tostring(lfs->L, -1)); lfs->name, lua_tostring(lfs->L, -1));
break; break;
#endif
default: default:
zlog_err("Lua hook call '%s' : unknown error: %s", lfs->name, zlog_err("Lua hook call '%s' : unknown error: %s", lfs->name,
lua_tostring(lfs->L, -1)); lua_tostring(lfs->L, -1));