[libvirt PATCH 26/32] src: conditionalize use of O_DIRECT

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

 



The O_DIRECT flag is not available on platforms, so we
must avoid it once we remove GNULIB.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 src/util/virfile.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/util/virfile.c b/src/util/virfile.c
index d0e0062aa7..617d5d7a48 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -178,7 +178,11 @@ virFileDirectFdFlag(void)
 {
     /* XXX For now, Linux posix_fadvise is not powerful enough to
      * avoid O_DIRECT.  */
+#ifdef O_DIRECT
     return O_DIRECT ? O_DIRECT : -1;
+#else
+    return -1;
+#endif
 }
 
 /* Opaque type for managing a wrapper around a fd.  For now,
-- 
2.24.1





[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]

  Powered by Linux