openbsd-ports/net/luasocket/patches/patch-src_tcp_c
robert a19d9af34a luasocket defines buffer_init(); which is common enough to be defined
elsewhere and it is defined in mod_magnet, so you end up with a SIGSEGV.
So rename buffer_* funcs to ls_buffer_*.
2009-08-22 20:28:40 +00:00

58 lines
2.2 KiB
Plaintext

$OpenBSD: patch-src_tcp_c,v 1.1 2009/08/22 20:28:40 robert Exp $
--- src/tcp.c.orig Thu Apr 27 05:23:21 2006
+++ src/tcp.c Sat Aug 22 22:19:02 2009
@@ -104,22 +104,22 @@ int tcp_open(lua_State *L)
\*-------------------------------------------------------------------------*/
static int meth_send(lua_State *L) {
p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
- return buffer_meth_send(L, &tcp->buf);
+ return ls_buffer_meth_send(L, &tcp->buf);
}
static int meth_receive(lua_State *L) {
p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
- return buffer_meth_receive(L, &tcp->buf);
+ return ls_buffer_meth_receive(L, &tcp->buf);
}
static int meth_getstats(lua_State *L) {
p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
- return buffer_meth_getstats(L, &tcp->buf);
+ return ls_buffer_meth_getstats(L, &tcp->buf);
}
static int meth_setstats(lua_State *L) {
p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
- return buffer_meth_setstats(L, &tcp->buf);
+ return ls_buffer_meth_setstats(L, &tcp->buf);
}
/*-------------------------------------------------------------------------*\
@@ -152,7 +152,7 @@ static int meth_setfd(lua_State *L)
static int meth_dirty(lua_State *L)
{
p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1);
- lua_pushboolean(L, !buffer_isempty(&tcp->buf));
+ lua_pushboolean(L, !ls_buffer_isempty(&tcp->buf));
return 1;
}
@@ -176,7 +176,7 @@ static int meth_accept(lua_State *L)
io_init(&clnt->io, (p_send) socket_send, (p_recv) socket_recv,
(p_error) socket_ioerror, &clnt->sock);
timeout_init(&clnt->tm, -1, -1);
- buffer_init(&clnt->buf, &clnt->io, &clnt->tm);
+ ls_buffer_init(&clnt->buf, &clnt->io, &clnt->tm);
return 1;
} else {
lua_pushnil(L);
@@ -329,7 +329,7 @@ static int global_create(lua_State *L)
io_init(&tcp->io, (p_send) socket_send, (p_recv) socket_recv,
(p_error) socket_ioerror, &tcp->sock);
timeout_init(&tcp->tm, -1, -1);
- buffer_init(&tcp->buf, &tcp->io, &tcp->tm);
+ ls_buffer_init(&tcp->buf, &tcp->io, &tcp->tm);
return 1;
} else {
lua_pushnil(L);