]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: silence recent syntax check violations
authorEric Blake <eblake@redhat.com>
Fri, 30 Mar 2012 03:17:30 +0000 (21:17 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 30 Mar 2012 03:23:59 +0000 (21:23 -0600)
An upstream gnulib bug[1] meant that some of our syntax checks
weren't being run.  Fix up our offenders before we upgrade to
a newer gnulib.

[1] https://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00194.html

* src/util/virnetdevtap.c (virNetDevTapCreate): Use flags.
* tests/lxcxml2xmltest.c (mymain): Strip useless ().

src/util/virnetdevtap.c
tests/lxcxml2xmltest.c

index 0b3ac4618315be2229d2106e1ffffa4aac6fc41b..717b6ac6b89dc0069e36c1adee0e294ef6077e6c 100644 (file)
@@ -129,12 +129,14 @@ virNetDevProbeVnetHdr(int tapfd)
  */
 int virNetDevTapCreate(char **ifname,
                        int *tapfd,
-                       unsigned int flags ATTRIBUTE_UNUSED)
+                       unsigned int flags)
 {
     int fd;
     struct ifreq ifr;
     int ret = -1;
 
+    virCheckFlags(VIR_NETDEV_TAP_CREATE_VNET_HDR, -1);
+
     if ((fd = open("/dev/net/tun", O_RDWR)) < 0) {
         virReportSystemError(errno, "%s",
                              _("Unable to open /dev/net/tun, is tun module loaded?"));
@@ -237,8 +239,9 @@ cleanup:
 #else /* ! TUNSETIFF */
 int virNetDevTapCreate(char **ifname ATTRIBUTE_UNUSED,
                        int *tapfd ATTRIBUTE_UNUSED,
-                       unsigned int flags ATTRIBUTE_UNUSED)
+                       unsigned int flags)
 {
+    virCheckFlags(0, -1);
     virReportSystemError(ENOSYS, "%s",
                          _("Unable to create TAP devices on this platform"));
     return -1;
index 558bd012c955db690add94c8ac1bf019fca37805..6a879393dc5659f5138a5601edd9521bc9ff3c3b 100644 (file)
@@ -99,7 +99,7 @@ mymain(void)
     int ret = 0;
 
     if ((caps = testLXCCapsInit()) == NULL)
-        return (EXIT_FAILURE);
+        return EXIT_FAILURE;
 
 # define DO_TEST_FULL(name, is_different, inactive)                     \
     do {                                                                \
@@ -124,7 +124,7 @@ mymain(void)
 
     virCapabilitiesFree(caps);
 
-    return (ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
+    return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }
 
 VIRT_TEST_MAIN(mymain)