qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 07/12] migration: use closesocket, not close


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH 07/12] migration: use closesocket, not close
Date: Fri, 2 Nov 2012 18:51:00 +0100

Windows requires this.  Migration does not quite work under Windows
but let's be uniform across QEMU.

Reviewed-by: Orit Wasserman <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
 migration-tcp.c | 6 +++---
 1 file modificato, 3 inserzioni(+), 3 rimozioni(-)

diff --git a/migration-tcp.c b/migration-tcp.c
index 96a832c..1a12f17 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;
@@ -89,7 +89,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");
 
@@ -107,7 +107,7 @@ static void tcp_accept_incoming_migration(void *opaque)
     process_incoming_migration(f);
     qemu_fclose(f);
 out:
-    close(c);
+    closesocket(c);
 }
 
 void tcp_start_incoming_migration(const char *host_port, Error **errp)
-- 
1.7.12.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]