summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJamey Hicks <jamey.hicks@nokia.com>2012-10-15 11:22:49 -0400
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-16 17:42:40 +0200
commitf052ce48432fc0f5582bcee05a2309438e59c9a4 (patch)
treed45336b9aae205c93f969d8d369effd60c780573
parent95635cda18a3154d3aa42376725b4f60c3ae0ab0 (diff)
use O_BINARY for hbtree files on Windows
Change-Id: I6685f42649feb1234f3254fd34e318e9b983abbb Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
-rw-r--r--src/hbtree/hbtree.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/hbtree/hbtree.cpp b/src/hbtree/hbtree.cpp
index fc1dabf4..a3873557 100644
--- a/src/hbtree/hbtree.cpp
+++ b/src/hbtree/hbtree.cpp
@@ -2967,6 +2967,9 @@ bool HBtree::open()
return false;
int oflags = d->openMode_ == ReadOnly ? O_RDONLY : O_RDWR | O_CREAT;
+#ifdef Q_OS_WIN32
+ oflags |= _O_BINARY; // otherwise write() does crlf conversions
+#endif
int fd = ::open(d->fileName_.toLatin1(), oflags, 0644);
if (fd == -1) {