aboutsummaryrefslogtreecommitdiff
path: root/migration-tcp.c
diff options
context:
space:
mode:
authorStefan Weil <weil@mail.berlios.de>2011-02-23 19:09:16 +0100
committerBlue Swirl <blauwirbel@gmail.com>2011-03-20 21:39:23 +0000
commite0efb993b817564ef84e462ac1fe35f89b57ad7b (patch)
tree805341589c14255dc94c5711d67140f346dcd1e5 /migration-tcp.c
parentd81e54de5919f46d911e971804bb4b4d77a8a88a (diff)
Fix conversions from pointer to int and vice versa
Here the int values fds[0], sigfd, s, sock and fd are converted to void pointers which are later converted back to an int value. These conversions should always use intptr_t instead of unsigned long. They are needed for environments where sizeof(long) != sizeof(void *). Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'migration-tcp.c')
-rw-r--r--migration-tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/migration-tcp.c b/migration-tcp.c
index b55f419b65..e8dff9d71a 100644
--- a/migration-tcp.c
+++ b/migration-tcp.c
@@ -139,7 +139,7 @@ static void tcp_accept_incoming_migration(void *opaque)
{
struct sockaddr_in addr;
socklen_t addrlen = sizeof(addr);
- int s = (unsigned long)opaque;
+ int s = (intptr_t)opaque;
QEMUFile *f;
int c;
@@ -194,7 +194,7 @@ int tcp_start_incoming_migration(const char *host_port)
goto err;
qemu_set_fd_handler2(s, NULL, tcp_accept_incoming_migration, NULL,
- (void *)(unsigned long)s);
+ (void *)(intptr_t)s);
return 0;