From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOnGP-0000Bc-Hx for qemu-devel@nongnu.org; Thu, 18 Oct 2012 06:23:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOnGG-0001iB-RT for qemu-devel@nongnu.org; Thu, 18 Oct 2012 06:23:41 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:62641) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOnGG-0001aH-MA for qemu-devel@nongnu.org; Thu, 18 Oct 2012 06:23:32 -0400 Received: by mail-pa0-f45.google.com with SMTP id fb10so8234740pad.4 for ; Thu, 18 Oct 2012 03:23:32 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 18 Oct 2012 12:22:33 +0200 Message-Id: <1350555758-29988-8-git-send-email-pbonzini@redhat.com> In-Reply-To: <1350555758-29988-1-git-send-email-pbonzini@redhat.com> References: <1350555758-29988-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 07/12] migration: use closesocket, not close List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: quintela@redhat.com Windows requires this. Migration does not quite work under Windows but let's be uniform across QEMU. Signed-off-by: Paolo Bonzini --- migration-tcp.c | 6 +++--- 1 file modificato, 3 inserzioni(+), 3 rimozioni(-) diff --git a/migration-tcp.c b/migration-tcp.c index 1bd8481..e797d23 100644 --- a/migration-tcp.c +++ b/migration-tcp.c @@ -45,7 +45,7 @@ static int tcp_close(MigrationState *s) int r = 0; DPRINTF("tcp_close\n"); if (s->fd != -1) { - if (close(s->fd) < 0) { + if (closesocket(s->fd) < 0) { r = -errno; } s->fd = -1; @@ -97,7 +97,7 @@ static void tcp_accept_incoming_migration(void *opaque) c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen); } while (c == -1 && socket_error() == EINTR); qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL); - close(s); + closesocket(s); DPRINTF("accepted migration\n"); @@ -115,7 +115,7 @@ static void tcp_accept_incoming_migration(void *opaque) process_incoming_migration(f); qemu_fclose(f); out: - close(c); + closesocket(c); } int tcp_start_incoming_migration(const char *host_port, Error **errp) -- 1.7.12.1