From 24a506e3c577952156f9d26bd63842a17ee24e0a Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 2 Apr 2009 13:34:16 +0200 Subject: [PATCH] luaa: close accepted socket on exec Signed-off-by: Uli Schlachter Signed-off-by: Julien Danjou --- luaa.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/luaa.c b/luaa.c index afe249ec5..91c49b7eb 100644 --- a/luaa.c +++ b/luaa.c @@ -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);