From 4a5ed4ca4a7f5082b29ae20a0b07f518c83b1152 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 9 Jan 2025 09:48:27 +0200 Subject: [PATCH] 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 --- lib/frrscript.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/frrscript.c b/lib/frrscript.c index 06460b014d8c..8b068ba61b73 100644 --- a/lib/frrscript.c +++ b/lib/frrscript.c @@ -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", lfs->name, lua_tostring(lfs->L, -1)); break; +#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM <= 503 case LUA_ERRGCMM: zlog_err("Lua hook call '%s' : garbage collector error: %s", lfs->name, lua_tostring(lfs->L, -1)); break; +#endif default: zlog_err("Lua hook call '%s' : unknown error: %s", lfs->name, lua_tostring(lfs->L, -1));