luaa: close accepted socket on exec

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Uli Schlachter 2009-04-02 13:34:16 +02:00 committed by Julien Danjou
parent 4722ba6c10
commit 24a506e3c5
1 changed files with 5 additions and 0 deletions

5
luaa.c
View File

@ -1102,6 +1102,11 @@ luaA_conn_cb(EV_P_ ev_io *w, int revents)
ev_io *csio_conn = p_new(ev_io, 1);
int csfd = accept(w->fd, NULL, NULL);
if(csfd < 0)
return;
fd_set_close_on_exec(csfd);
ev_io_init(csio_conn, &luaA_cb, csfd, EV_READ);
ev_io_start(EV_DEFAULT_UC_ csio_conn);
ev_unref(EV_DEFAULT_UC);