mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-22 22:13:18 +00:00
src: conditionalize use of O_BINARY
The O_BINARY flag is not defined on all platforms so we must conditionalize its use once we remove GNULIB. Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
b0bea258d3
commit
6dd8913207
@ -1243,7 +1243,10 @@ virFDStreamOpenFileInternal(virStreamPtr st,
|
|||||||
VIR_DEBUG("st=%p path=%s oflags=0x%x offset=%llu length=%llu mode=0%o",
|
VIR_DEBUG("st=%p path=%s oflags=0x%x offset=%llu length=%llu mode=0%o",
|
||||||
st, path, oflags, offset, length, mode);
|
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)
|
if (oflags & O_CREAT)
|
||||||
fd = open(path, oflags, mode);
|
fd = open(path, oflags, mode);
|
||||||
|
Loading…
Reference in New Issue
Block a user