* [Qemu-devel] [PATCH] Close socket file descriptor when qemu_accept fails
@ 2010-07-24 10:03 Shahar Havivi
2010-07-25 15:12 ` Aurelien Jarno
0 siblings, 1 reply; 2+ messages in thread
From: Shahar Havivi @ 2010-07-24 10:03 UTC (permalink / raw)
To: qemu-devel
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] Close socket file descriptor when qemu_accept fails
2010-07-24 10:03 [Qemu-devel] [PATCH] Close socket file descriptor when qemu_accept fails Shahar Havivi
@ 2010-07-25 15:12 ` Aurelien Jarno
0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2010-07-25 15:12 UTC (permalink / raw)
To: Shahar Havivi; +Cc: qemu-devel
On Sat, Jul 24, 2010 at 01:03:07PM +0300, Shahar Havivi wrote:
>
> Signed-off-by: Shahar Havivi <shaharh@redhat.com>
> ---
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-25 15:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-24 10:03 [Qemu-devel] [PATCH] Close socket file descriptor when qemu_accept fails Shahar Havivi
2010-07-25 15:12 ` Aurelien Jarno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).