mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 14:29:47 +00:00
lib: Fix dead code from lua_dofile
Signed-off-by: Donald Lee <dlqs@gmx.com>
This commit is contained in:
parent
efadadc1b6
commit
868b41d97b
@ -281,40 +281,12 @@ int frrscript_load(struct frrscript *fs, const char *function_name,
|
|||||||
scriptdir, fs->name);
|
scriptdir, fs->name);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
int ret = luaL_dofile(L, script_name);
|
|
||||||
|
|
||||||
switch (ret) {
|
if (luaL_dofile(L, script_name) != 0) {
|
||||||
case LUA_OK:
|
zlog_err("frrscript: failed loading script '%s.lua': error: %s",
|
||||||
break;
|
script_name, lua_tostring(L, -1));
|
||||||
case LUA_ERRSYNTAX:
|
|
||||||
zlog_err(
|
|
||||||
"frrscript: failed loading script '%s.lua': syntax error: %s",
|
|
||||||
script_name, lua_tostring(L, -1));
|
|
||||||
break;
|
|
||||||
case LUA_ERRMEM:
|
|
||||||
zlog_err(
|
|
||||||
"frrscript: failed loading script '%s.lua': out-of-memory error: %s",
|
|
||||||
script_name, lua_tostring(L, -1));
|
|
||||||
break;
|
|
||||||
case LUA_ERRGCMM:
|
|
||||||
zlog_err(
|
|
||||||
"frrscript: failed loading script '%s.lua': garbage collector error: %s",
|
|
||||||
script_name, lua_tostring(L, -1));
|
|
||||||
break;
|
|
||||||
case LUA_ERRFILE:
|
|
||||||
zlog_err(
|
|
||||||
"frrscript: failed loading script '%s.lua': file read error: %s",
|
|
||||||
script_name, lua_tostring(L, -1));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
zlog_err(
|
|
||||||
"frrscript: failed loading script '%s.lua': unknown error: %s",
|
|
||||||
script_name, lua_tostring(L, -1));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret != LUA_OK)
|
|
||||||
goto fail;
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
/* Push the Lua function we want */
|
/* Push the Lua function we want */
|
||||||
lua_getglobal(L, function_name);
|
lua_getglobal(L, function_name);
|
||||||
|
Loading…
Reference in New Issue
Block a user