From: Shahar Havivi <shaharh@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Close socket file descriptor when qemu_accept fails
Date: Sat, 24 Jul 2010 13:03:07 +0300 [thread overview]
Message-ID: <20100724100303.GA23454@redhat.com> (raw)
Signed-off-by: Shahar Havivi <shaharh@redhat.com>
---
migration-tcp.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
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
next reply other threads:[~2010-07-24 10:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-24 10:03 Shahar Havivi [this message]
2010-07-25 15:12 ` [Qemu-devel] [PATCH] Close socket file descriptor when qemu_accept fails Aurelien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100724100303.GA23454@redhat.com \
--to=shaharh@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.