From 6dd8913207fc3ea916d6534363f1ed73abbc4934 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Wed, 22 Jan 2020 11:48:05 +0000 Subject: [PATCH] src: conditionalize use of O_BINARY MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The O_BINARY flag is not defined on all platforms so we must conditionalize its use once we remove GNULIB. Reviewed-by: Pavel Hrdina Signed-off-by: Daniel P. Berrangé --- 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.47.2