[libvirt PATCH 27/32] src: conditionalize use of O_BINARY

Daniel P. Berrangé berrange at redhat.com
Thu Jan 23 11:43:20 UTC 2020


The O_BINARY flag is not defined on all platforms so we must
conditionalize its use once we remove GNULIB.

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 src/util/virfdstream.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/util/virfdstream.c b/src/util/virfdstream.c
index a903107afb..58b77aa6fa 100644
--- a/src/util/virfdstream.c
+++ b/src/util/virfdstream.c
@@ -1243,7 +1243,10 @@ virFDStreamOpenFileInternal(virStreamPtr st,
     VIR_DEBUG("st=%p path=%s oflags=0x%x offset=%llu length=%llu mode=0%o",
               st, path, oflags, offset, length, mode);
 
-    oflags |= O_NOCTTY | O_BINARY;
+    oflags |= O_NOCTTY;
+#ifdef O_BINARY
+    oflags |= O_BINARY;
+#endif
 
     if (oflags & O_CREAT)
         fd = open(path, oflags, mode);
-- 
2.24.1




More information about the libvir-list mailing list