From: Andrea Bolognani Date: Tue, 14 Jul 2020 19:52:10 +0000 (+0200) Subject: tests: Minimize variable scope X-Git-Tag: v6.6.0-rc1~104 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=deceb1e09f4312c4d4023f9f21498f20d1b0ac87;p=thirdparty%2Flibvirt.git tests: Minimize variable scope Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index f56e623cb3..96c582216c 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -55,13 +55,14 @@ checkProtocols(bool *hasIPv4, bool *hasIPv6, return -1; for (i = 0; i < 50; i++) { - int only = 1; if (*hasIPv4) { if ((s4 = socket(AF_INET, SOCK_STREAM, 0)) < 0) goto cleanup; } if (*hasIPv6) { + int only = 1; + if ((s6 = socket(AF_INET6, SOCK_STREAM, 0)) < 0) goto cleanup;