aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2013-03-08 19:58:32 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-03-22 13:14:48 +0100
commit9957fc7f1ed731e5228089ead3f350341cdd29c0 (patch)
tree874a4ac706c39aa05f66d285e3d3db20bf83e3f3 /util
parentafed26082219b49443193b4ac32d113bbcf967fd (diff)
downloadqemu-9957fc7f1ed731e5228089ead3f350341cdd29c0.zip
qemu-9957fc7f1ed731e5228089ead3f350341cdd29c0.tar.gz
qemu-9957fc7f1ed731e5228089ead3f350341cdd29c0.tar.bz2
MinGW: Replace setsockopt by qemu_setsocketopt
Instead of adding missing type casts which are needed by MinGW for the 4th argument, the patch uses qemu_setsockopt which was invented for this purpose. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'util')
-rw-r--r--util/qemu-sockets.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 83e4e08..d70bbf0 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -156,12 +156,12 @@ int inet_listen_opts(QemuOpts *opts, int port_offset, Error **errp)
continue;
}
- setsockopt(slisten,SOL_SOCKET,SO_REUSEADDR,(void*)&on,sizeof(on));
+ qemu_setsockopt(slisten, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
#ifdef IPV6_V6ONLY
if (e->ai_family == PF_INET6) {
/* listen on both ipv4 and ipv6 */
- setsockopt(slisten,IPPROTO_IPV6,IPV6_V6ONLY,(void*)&off,
- sizeof(off));
+ qemu_setsockopt(slisten, IPPROTO_IPV6, IPV6_V6ONLY, &off,
+ sizeof(off));
}
#endif
@@ -229,7 +229,7 @@ static void wait_for_connect(void *opaque)
qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
do {
- rc = getsockopt(s->fd, SOL_SOCKET, SO_ERROR, (void *) &val, &valsize);
+ rc = qemu_getsockopt(s->fd, SOL_SOCKET, SO_ERROR, &val, &valsize);
} while (rc == -1 && socket_error() == EINTR);
/* update rc to contain error */
@@ -456,7 +456,7 @@ int inet_dgram_opts(QemuOpts *opts, Error **errp)
error_set_errno(errp, errno, QERR_SOCKET_CREATE_FAILED);
goto err;
}
- setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,(void*)&on,sizeof(on));
+ qemu_setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
/* bind socket */
if (bind(sock, local->ai_addr, local->ai_addrlen) < 0) {