chunk: On Windows, chunk_map() opens files in binary mode

This commit is contained in:
Martin Willi
2014-06-04 15:53:08 +02:00
parent 2877355408
commit c5447bc2f5
+7 -2
View File
@@ -333,10 +333,15 @@ chunk_t *chunk_map(char *path, bool wr)
{
mmaped_chunk_t *chunk;
struct stat sb;
int tmp;
int tmp, flags;
flags = wr ? O_RDWR : O_RDONLY;
#ifdef WIN32
flags |= O_BINARY;
#endif
INIT(chunk,
.fd = open(path, wr ? O_RDWR : O_RDONLY),
.fd = open(path, flags),
.wr = wr,
);