Skip to content

Commit

Permalink
util/qemu-sockets.c: Avoid unused variable warnings
Browse files Browse the repository at this point in the history
The 'on' variable is never used, and 'off' is only used
if IPV6_V6ONLY is defined; delete 'on' and move 'off' to
the point where it is used. This avoids warnings from
clang 3.4.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
pm215 authored and Michael Tokarev committed Jun 10, 2014
1 parent 7179585 commit f9b5426
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions util/qemu-sockets.c
Expand Up @@ -30,8 +30,6 @@
# define AI_ADDRCONFIG 0
#endif

static const int on=1, off=0;

/* used temporarily until all users are converted to QemuOpts */
QemuOptsList socket_optslist = {
.name = "socket",
Expand Down Expand Up @@ -159,6 +157,7 @@ int inet_listen_opts(QemuOpts *opts, int port_offset, Error **errp)
#ifdef IPV6_V6ONLY
if (e->ai_family == PF_INET6) {
/* listen on both ipv4 and ipv6 */
const int off = 0;
qemu_setsockopt(slisten, IPPROTO_IPV6, IPV6_V6ONLY, &off,
sizeof(off));
}
Expand Down

0 comments on commit f9b5426

Please sign in to comment.