aboutsummaryrefslogtreecommitdiff
path: root/src/unix.c
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2002-12-02 23:34:41 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2002-12-02 23:34:41 +0000
commitd7e80592a69c076991ed4f4cc15d5390e14d1f0b (patch)
tree5fd9c99742b4a03e6a66f940a1f86f98d4db50c8 /src/unix.c
parentb796207ce06a66b04cce6686b3fa664c06703995 (diff)
downloadluasocket-d7e80592a69c076991ed4f4cc15d5390e14d1f0b.tar.gz
luasocket-d7e80592a69c076991ed4f4cc15d5390e14d1f0b.tar.bz2
luasocket-d7e80592a69c076991ed4f4cc15d5390e14d1f0b.zip
Already compiling and running for Lua 5.0 (alpha)
Diffstat (limited to 'src/unix.c')
-rw-r--r--src/unix.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/unix.c b/src/unix.c
index d50d98c..0fc08bd 100644
--- a/src/unix.c
+++ b/src/unix.c
@@ -28,7 +28,7 @@ void compat_open(lua_State *L)
28} 28}
29 29
30COMPAT_FD compat_accept(COMPAT_FD s, struct sockaddr *addr, 30COMPAT_FD compat_accept(COMPAT_FD s, struct sockaddr *addr,
31 socklen_t *len, int deadline) 31 int *len, int deadline)
32{ 32{
33 struct timeval tv; 33 struct timeval tv;
34 fd_set fds; 34 fd_set fds;
@@ -74,7 +74,7 @@ int compat_send(COMPAT_FD c, cchar *data, size_t count, size_t *sent,
74} 74}
75 75
76int compat_sendto(COMPAT_FD c, cchar *data, size_t count, size_t *sent, 76int compat_sendto(COMPAT_FD c, cchar *data, size_t count, size_t *sent,
77 int deadline, SA *addr, socklen_t len) 77 int deadline, SA *addr, int len)
78{ 78{
79 struct timeval tv; 79 struct timeval tv;
80 fd_set fds; 80 fd_set fds;
@@ -134,7 +134,7 @@ int compat_recv(COMPAT_FD c, uchar *data, size_t count, size_t *got,
134} 134}
135 135
136int compat_recvfrom(COMPAT_FD c, uchar *data, size_t count, size_t *got, 136int compat_recvfrom(COMPAT_FD c, uchar *data, size_t count, size_t *got,
137 int deadline, SA *addr, socklen_t *len) 137 int deadline, SA *addr, int *len)
138{ 138{
139 struct timeval tv; 139 struct timeval tv;
140 fd_set fds; 140 fd_set fds;
@@ -290,7 +290,7 @@ cchar *compat_trysetoptions(lua_State *L, COMPAT_FD sock)
290static cchar *try_setbooloption(lua_State *L, COMPAT_FD sock, int name) 290static cchar *try_setbooloption(lua_State *L, COMPAT_FD sock, int name)
291{ 291{
292 int bool, res; 292 int bool, res;
293 if (!lua_isnumber(L, -1)) lua_error(L, "invalid option value"); 293 if (!lua_isnumber(L, -1)) luaL_error(L, "invalid option value");
294 bool = (int) lua_tonumber(L, -1); 294 bool = (int) lua_tonumber(L, -1);
295 res = setsockopt(sock, SOL_SOCKET, name, (char *) &bool, sizeof(bool)); 295 res = setsockopt(sock, SOL_SOCKET, name, (char *) &bool, sizeof(bool));
296 if (res < 0) return "error setting option"; 296 if (res < 0) return "error setting option";