From: Marek VavruĊĦa Date: Wed, 1 Apr 2015 14:29:29 +0000 (+0200) Subject: daemon/lua: disabled syntactic sugar, as the getenvf is not in Lua 5.2 X-Git-Tag: v1.0.0-beta1~270 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2c5505125460aa89a47a2fee3875cc41601e1b7;p=thirdparty%2Fknot-resolver.git daemon/lua: disabled syntactic sugar, as the getenvf is not in Lua 5.2 --- diff --git a/daemon/engine.c b/daemon/engine.c index 861720729..8d33a4d2f 100644 --- a/daemon/engine.c +++ b/daemon/engine.c @@ -199,6 +199,8 @@ static int engine_loadconf(struct engine *engine) #include "daemon/lua/init.inc" }; 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); } @@ -216,7 +218,7 @@ static int engine_loadconf(struct engine *engine) /* Evaluate */ 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); return kr_error(EINVAL); } diff --git a/daemon/lua/init.lua b/daemon/lua/init.lua index e71b08720..879267436 100644 --- a/daemon/lua/init.lua +++ b/daemon/lua/init.lua @@ -28,5 +28,5 @@ function protect(defined) end }) end -_G = protect(getfenv(0)) -setfenv(0, _G) +-- _G = protect(getfenv(0)) +-- setfenv(0, _G)