Received: from [140.186.70.92] (port=49856 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Od2sM-0003c5-S0 for qemu-devel@nongnu.org; Sun, 25 Jul 2010 11:12:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Od2sB-0001pM-Aq for qemu-devel@nongnu.org; Sun, 25 Jul 2010 11:12:16 -0400 Received: from hall.aurel32.net ([88.191.82.174]:40588) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Od2sB-0001p7-5H for qemu-devel@nongnu.org; Sun, 25 Jul 2010 11:12:15 -0400 Date: Sun, 25 Jul 2010 17:12:14 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] Close socket file descriptor when qemu_accept fails Message-ID: <20100725151214.GG22478@hall.aurel32.net> References: <20100724100303.GA23454@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20100724100303.GA23454@redhat.com> Sender: Aurelien Jarno List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shahar Havivi Cc: qemu-devel@nongnu.org On Sat, Jul 24, 2010 at 01:03:07PM +0300, Shahar Havivi wrote: > > Signed-off-by: Shahar Havivi > --- > migration-tcp.c | 5 +++-- > 1 files changed, 3 insertions(+), 2 deletions(-) Thanks, applied. > diff --git a/migration-tcp.c b/migration-tcp.c > index 78b56dc..b55f419 100644 > --- a/migration-tcp.c > +++ b/migration-tcp.c > @@ -151,7 +151,7 @@ static void tcp_accept_incoming_migration(void *opaque) > > if (c == -1) { > fprintf(stderr, "could not accept migration connection\n"); > - return; > + goto out2; > } > > f = qemu_fopen_socket(c); > @@ -163,9 +163,10 @@ static void tcp_accept_incoming_migration(void *opaque) > process_incoming_migration(f); > qemu_fclose(f); > out: > + close(c); > +out2: > qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL); > close(s); > - close(c); > } > > int tcp_start_incoming_migration(const char *host_port) > -- > 1.7.1.1 > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net