From: Peter van Dijk Date: Wed, 10 Oct 2012 14:53:16 +0000 (+0000) Subject: allow luabackend to compile with Lua 5.2, patch by Fredrik Danerklint X-Git-Tag: auth-3.2-rc1~88 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=67f30c7437daa8d334eff8a040c92f3954b504d0;p=thirdparty%2Fpdns.git allow luabackend to compile with Lua 5.2, patch by Fredrik Danerklint git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2794 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/modules/luabackend/reload.cc b/modules/luabackend/reload.cc index ee00d5bacb..1d6850bf90 100644 --- a/modules/luabackend/reload.cc +++ b/modules/luabackend/reload.cc @@ -61,9 +61,13 @@ void LUABackend::reload() { lua_close(lua); logging = ::arg().mustDo("query-logging") || mustDo("logging-query"); - + +#ifdef LUA_VERSION_MAJOR == 5 && LUA_VERSION_MINOR > 1 + lua = luaL_newstate(); +#else lua = lua_open(); - +#endif + if (lua != NULL) { lua_atpanic(lua, my_lua_panic);