diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-09-27 13:33:08 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2012-11-02 18:35:07 +0100 |
commit | 09bac73c13b57acd304efb54a361c244d60d375c (patch) | |
tree | f8af037c0bb9b126c2ea010384ebdd5a5f294354 /migration-tcp.c | |
parent | 8dc592e620b45c4745380b0694ec1aedc073bda2 (diff) |
migration: use closesocket, not close
Windows requires this. Migration does not quite work under Windows
but let's be uniform across QEMU.
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'migration-tcp.c')
-rw-r--r-- | migration-tcp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/migration-tcp.c b/migration-tcp.c index 96a832caa8..1a12f17886 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) |