[libvirt] [PATCH 3/4] util: Adjust the #ifdef logic in virNetDevBridgeCreate

John Ferlan jferlan at redhat.com
Wed Jun 28 11:37:37 UTC 2017


Commit id 'adf846d3' added many ATTRIBUTE_FALLTHROUGH; statements;
however, this particular one caught the eye of the Coverity checker
which notes that the statement isn't reachable when the # if is true.

While it could be considered a false positive, just add an # else in
order to make it more obvious.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/util/virnetdevbridge.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c
index 11b03b4..1361a51 100644
--- a/src/util/virnetdevbridge.c
+++ b/src/util/virnetdevbridge.c
@@ -478,11 +478,12 @@ virNetDevBridgeCreate(const char *brname)
              */
             rc = virNetDevBridgeCreateWithIoctl(brname);
             goto cleanup;
-# endif
+# else
             /* intentionally fall through if virNetDevBridgeCreateWithIoctl()
              * isn't available.
              */
             ATTRIBUTE_FALLTHROUGH;
+# endif
         default:
             virReportSystemError(-err->error,
                                  _("error creating bridge interface %s"),
-- 
2.9.4




More information about the libvir-list mailing list