]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon: fixed Lua 5.2
authorMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 1 Apr 2015 14:17:30 +0000 (16:17 +0200)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 1 Apr 2015 14:17:30 +0000 (16:17 +0200)
daemon/bindings.c

index f8a80df7261319602125397401441d7cbd537a78..5ed40a3c43f09e0acf8660235d993856398cc89b 100644 (file)
@@ -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