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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---

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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]