summaryrefslogtreecommitdiffstats
path: root/lem/io/unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'lem/io/unix.c')
-rw-r--r--lem/io/unix.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/lem/io/unix.c b/lem/io/unix.c
index 0a59d3d..ec1c22e 100644
--- a/lem/io/unix.c
+++ b/lem/io/unix.c
@@ -191,19 +191,8 @@ unix_listen_reap(struct lem_async *a)
int sock = u->sock;
if (sock >= 0) {
- struct ev_io *w;
-
free(u);
-
- /* create userdata and set the metatable */
- w = lua_newuserdata(T, sizeof(struct ev_io));
- lua_pushvalue(T, 2);
- lua_setmetatable(T, -2);
-
- /* initialize userdata */
- ev_io_init(w, NULL, sock, EV_READ);
- w->data = NULL;
-
+ server_new(T, sock, 2);
lem_queue(T, 1);
return;
}