From: Marek VavruĊĦa Date: Wed, 1 Apr 2015 14:17:30 +0000 (+0200) Subject: daemon: fixed Lua 5.2 X-Git-Tag: v1.0.0-beta1~271 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=153ffd53e4fbb21fc60a1a08292f946430fd1afe;p=thirdparty%2Fknot-resolver.git daemon: fixed Lua 5.2 --- diff --git a/daemon/bindings.c b/daemon/bindings.c index f8a80df72..5ed40a3c4 100644 --- a/daemon/bindings.c +++ b/daemon/bindings.c @@ -21,7 +21,7 @@ /** @internal Compatibility wrapper for Lua 5.0 - 5.2 */ #if LUA_VERSION_NUM < 502 -#define lua_len(L, obj) \ +#define lua_rawlen(L, obj) \ lua_objlen((L), (obj)) #define register_lib(L, name, lib) \ luaL_openlib((L), (name), (lib), 0) @@ -186,7 +186,7 @@ static int net_interfaces(lua_State *L) buf[0] = '\0'; } lua_pushstring(L, buf); - lua_rawseti(L, -2, lua_len(L, -2) + 1); + lua_rawseti(L, -2, lua_rawlen(L, -2) + 1); lua_setfield(L, -2, "addr"); /* Hardware address. */ @@ -265,5 +265,5 @@ int lib_cache(lua_State *L) }; register_lib(L, "cache", lib); - return 0; + return 1; } \ No newline at end of file