util/qemu-sockets.c: Avoid unused variable warnings
authorPeter Maydell <peter.maydell@linaro.org>
Sat, 7 Jun 2014 16:48:03 +0000 (17:48 +0100)
committerMunkyu Im <munkyu.im@samsung.com>
Fri, 12 Jun 2015 09:58:15 +0000 (18:58 +0900)
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.

Change-Id: Ia886bd9b95c0b019d5808834cf704bc97a3cd312
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
util/qemu-sockets.c

index 43e48cab1e935f8e482fac1f60c7d9eadb30d59a..18991c10a4a2e319bada19c90e985333f665afd5 100644 (file)
@@ -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));
         }