aboutsummaryrefslogtreecommitdiff
path: root/src/inet.c
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2003-06-09 18:23:40 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2003-06-09 18:23:40 +0000
commit58bdb658aaa1c30a8f3bed46eef880d308fae582 (patch)
tree5bf880c715daff79c1a2062f2f3ae8336858c83f /src/inet.c
parentb2724ad2d1cc3768a04270ed3f8014ec65ad133b (diff)
downloadluasocket-58bdb658aaa1c30a8f3bed46eef880d308fae582.tar.gz
luasocket-58bdb658aaa1c30a8f3bed46eef880d308fae582.tar.bz2
luasocket-58bdb658aaa1c30a8f3bed46eef880d308fae582.zip
Select re-implemented in a nicer way.
Few changes in internal class and group registration. Lua modules are compiled and built into library. Dynamic library tested in Linux and Mac OS X.
Diffstat (limited to 'src/inet.c')
-rw-r--r--src/inet.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/inet.c b/src/inet.c
index f20762f..60106f2 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -38,6 +38,7 @@ static luaL_reg func[] = {
38void inet_open(lua_State *L) 38void inet_open(lua_State *L)
39{ 39{
40 luaL_openlib(L, LUASOCKET_LIBNAME, func, 0); 40 luaL_openlib(L, LUASOCKET_LIBNAME, func, 0);
41 lua_pop(L, 1);
41} 42}
42 43
43/*=========================================================================*\ 44/*=========================================================================*\
@@ -114,7 +115,7 @@ static int inet_global_tohostname(lua_State *L)
114int inet_meth_getpeername(lua_State *L, p_sock ps) 115int inet_meth_getpeername(lua_State *L, p_sock ps)
115{ 116{
116 struct sockaddr_in peer; 117 struct sockaddr_in peer;
117 size_t peer_len = sizeof(peer); 118 socklen_t peer_len = sizeof(peer);
118 if (getpeername(*ps, (SA *) &peer, &peer_len) < 0) { 119 if (getpeername(*ps, (SA *) &peer, &peer_len) < 0) {
119 lua_pushnil(L); 120 lua_pushnil(L);
120 return 1; 121 return 1;
@@ -135,7 +136,7 @@ int inet_meth_getpeername(lua_State *L, p_sock ps)
135int inet_meth_getsockname(lua_State *L, p_sock ps) 136int inet_meth_getsockname(lua_State *L, p_sock ps)
136{ 137{
137 struct sockaddr_in local; 138 struct sockaddr_in local;
138 size_t local_len = sizeof(local); 139 socklen_t local_len = sizeof(local);
139 if (getsockname(*ps, (SA *) &local, &local_len) < 0) { 140 if (getsockname(*ps, (SA *) &local, &local_len) < 0) {
140 lua_pushnil(L); 141 lua_pushnil(L);
141 return 1; 142 return 1;