[libvirt] [PATCH] build: fix building with '--enable-test-locking'

Martin Kletzander mkletzan at redhat.com
Wed Dec 18 09:35:00 UTC 2013


When test-locking is enabled, CFLAGS have -Dbool=char, which makes
pipefd[bool] fail (obviously).  Forcing the subscript to be bool by
double negation fixes the build breaker.

Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---

Notes:
    I still can't build with '--enable-test-locking' and I'm not sure this
    is the proper way to fix it.  Also, the code wasn't touched for
    months, so I'm not pushing it as a build-breaker.

 src/util/virfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virfile.c b/src/util/virfile.c
index 631cd06..88674ec 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -262,7 +262,7 @@ virFileWrapperFdNew(int *fd, const char *name, unsigned int flags)
     }

     VIR_FORCE_CLOSE(*fd);
-    *fd = pipefd[output];
+    *fd = pipefd[!!output];
     return ret;

 error:
-- 
1.8.5.1




More information about the libvir-list mailing list