diff options
Diffstat (limited to 'src/inet.c')
-rw-r--r-- | src/inet.c | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -35,17 +35,10 @@ static luaL_reg func[] = { | |||
35 | /*-------------------------------------------------------------------------*\ | 35 | /*-------------------------------------------------------------------------*\ |
36 | * Initializes module | 36 | * Initializes module |
37 | \*-------------------------------------------------------------------------*/ | 37 | \*-------------------------------------------------------------------------*/ |
38 | void inet_open(lua_State *L) | 38 | int inet_open(lua_State *L) |
39 | { | 39 | { |
40 | lua_pushstring(L, LUASOCKET_LIBNAME); | 40 | lua_pushstring(L, LUASOCKET_LIBNAME); |
41 | lua_gettable(L, LUA_GLOBALSINDEX); | 41 | lua_gettable(L, LUA_GLOBALSINDEX); |
42 | if (lua_isnil(L, -1)) { | ||
43 | lua_pop(L, 1); | ||
44 | lua_newtable(L); | ||
45 | lua_pushstring(L, LUASOCKET_LIBNAME); | ||
46 | lua_pushvalue(L, -2); | ||
47 | lua_settable(L, LUA_GLOBALSINDEX); | ||
48 | } | ||
49 | lua_pushstring(L, "dns"); | 42 | lua_pushstring(L, "dns"); |
50 | lua_newtable(L); | 43 | lua_newtable(L); |
51 | luaL_openlib(L, NULL, func, 0); | 44 | luaL_openlib(L, NULL, func, 0); |