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

Daniel P. Berrangé posted 56 patches 6 years ago
There is a newer version of this series
[libvirt PATCH v2 27/56] src: conditionalize use of O_BINARY
Posted by Daniel P. Berrangé 6 years ago
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@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

Re: [libvirt PATCH v2 27/56] src: conditionalize use of O_BINARY
Posted by Pavel Hrdina 6 years ago
On Tue, Jan 28, 2020 at 01:11:08PM +0000, Daniel P. Berrangé wrote:
> 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@redhat.com>
> ---
>  src/util/virfdstream.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Same comment as for previous patch.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>