summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorPeter Maydell2014-06-07 18:48:03 +0200
committerMichael Tokarev2014-06-10 17:39:34 +0200
commitf9b5426fd50a60d9fda2c061c24f60537666e9af (patch)
tree433c91479ca38bd6eb6cf38b3297b794a2953460 /util
parenthw/sd/sd.c: Drop unused sd_acmd_type[] array (diff)
downloadqemu-f9b5426fd50a60d9fda2c061c24f60537666e9af.tar.gz
qemu-f9b5426fd50a60d9fda2c061c24f60537666e9af.tar.xz
qemu-f9b5426fd50a60d9fda2c061c24f60537666e9af.zip
util/qemu-sockets.c: Avoid unused variable warnings
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>
Diffstat (limited to 'util')
-rw-r--r--util/qemu-sockets.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 627e60931a..e3d29eebb8 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -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",
@@ -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));
}