Commit a2c55051 authored by Marek Vavruša's avatar Marek Vavruša

daemon/lua: disabled syntactic sugar, as the getenvf is not in Lua 5.2

parent 153ffd53
...@@ -199,6 +199,8 @@ static int engine_loadconf(struct engine *engine) ...@@ -199,6 +199,8 @@ static int engine_loadconf(struct engine *engine)
#include "daemon/lua/init.inc" #include "daemon/lua/init.inc"
}; };
if (luaL_dostring(engine->L, l_init) != 0) { if (luaL_dostring(engine->L, l_init) != 0) {
fprintf(stderr, "[system] error %s\n", lua_tostring(engine->L, -1));
lua_pop(engine->L, 1);
return kr_error(ENOEXEC); return kr_error(ENOEXEC);
} }
...@@ -216,7 +218,7 @@ static int engine_loadconf(struct engine *engine) ...@@ -216,7 +218,7 @@ static int engine_loadconf(struct engine *engine)
/* Evaluate */ /* Evaluate */
if (ret != 0) { if (ret != 0) {
fprintf(stderr, "error: %s\n", lua_tostring(engine->L, -1)); fprintf(stderr, "[system] error %s\n", lua_tostring(engine->L, -1));
lua_pop(engine->L, 1); lua_pop(engine->L, 1);
return kr_error(EINVAL); return kr_error(EINVAL);
} }
......
...@@ -28,5 +28,5 @@ function protect(defined) ...@@ -28,5 +28,5 @@ function protect(defined)
end end
}) })
end end
_G = protect(getfenv(0)) -- _G = protect(getfenv(0))
setfenv(0, _G) -- setfenv(0, _G)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment