Skip to content
Snippets Groups Projects
Commit 153ffd53 authored by Marek Vavruša's avatar Marek Vavruša
Browse files

daemon: fixed Lua 5.2

parent 2321d124
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment