From: Pieter Lexis Date: Wed, 4 Nov 2015 09:33:33 +0000 (+0100) Subject: Merge pull request #1255 from RvdE/patch-2 X-Git-Tag: dnsdist-1.0.0-alpha1~255 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86211311d1cfcd18e9e60e33c1a1ab904bffe465;p=pdns Merge pull request #1255 from RvdE/patch-2 RFC: Fix for issue #1252 --- 86211311d1cfcd18e9e60e33c1a1ab904bffe465 diff --cc modules/luabackend/lua_functions.cc index 7d627a719,17a903b33..a8d3f8dbc --- a/modules/luabackend/lua_functions.cc +++ b/modules/luabackend/lua_functions.cc @@@ -257,28 -238,30 +257,30 @@@ bool LUABackend::getValueFromTable(lua_ return ret; } + #if !(defined(__i386__) && defined(__FreeBSD__)) bool LUABackend::getValueFromTable(lua_State *lua, const std::string& key, time_t& value) { - lua_pushstring(lua, key.c_str()); - lua_gettable(lua, -2); + lua_pushstring(lua, key.c_str()); + lua_gettable(lua, -2); bool ret = false; - + if(!lua_isnil(lua, -1)) { value = (time_t)lua_tonumber(lua, -1); ret = true; } - + lua_pop(lua, 1); - + return ret; } + #endif bool LUABackend::getValueFromTable(lua_State *lua, const std::string& key, uint32_t& value) { - lua_pushstring(lua, key.c_str()); - lua_gettable(lua, -2); + lua_pushstring(lua, key.c_str()); + lua_gettable(lua, -2); bool ret = false; - + if(!lua_isnil(lua, -1)) { value = (uint32_t)lua_tonumber(lua, -1); ret = true; diff --cc modules/luabackend/luabackend.hh index 03d6222e1,98901a01b..0a90553e3 --- a/modules/luabackend/luabackend.hh +++ b/modules/luabackend/luabackend.hh @@@ -153,9 -154,10 +153,11 @@@ private // FUNCTIONS TO THIS BACKEND bool getValueFromTable(lua_State *lua, const std::string& key, string& value); + bool getValueFromTable(lua_State *lua, const std::string& key, DNSName& value); bool getValueFromTable(lua_State *lua, uint32_t key, string& value); + #if !(defined(__i386__) && defined(__FreeBSD__)) bool getValueFromTable(lua_State *lua, const std::string& key, time_t& value); + #endif bool getValueFromTable(lua_State *lua, const std::string& key, uint32_t& value); bool getValueFromTable(lua_State *lua, const std::string& key, uint16_t& value); bool getValueFromTable(lua_State *lua, const std::string& key, int& value);