提交 9f219dca 编写于 作者: C Claudio Bley

Always open files in binary mode in virFDStreamOpenFileInternal

On win32, using text mode for binary files might result in short
reads since ASCII character 0x1A is interpreted as EOF. Also, it
could lead to problems using the seek functions because of the \r
handling.
Signed-off-by: NClaudio Bley <cbley@av-test.de>
上级 291edf70
......@@ -593,7 +593,7 @@ virFDStreamOpenFileInternal(virStreamPtr st,
VIR_DEBUG("st=%p path=%s oflags=%x offset=%llu length=%llu mode=%o",
st, path, oflags, offset, length, mode);
oflags |= O_NOCTTY;
oflags |= O_NOCTTY | O_BINARY;
if (oflags & O_CREAT)
fd = open(path, oflags, mode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册