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>
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;
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");
process_incoming_migration(f);
qemu_fclose(f);
out:
- close(c);
+ closesocket(c);
}
void tcp_start_incoming_migration(const char *host_port, Error **errp)