summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libopts/text_mmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libopts/text_mmap.c b/src/libopts/text_mmap.c
index 07c0bf10eb..d5e074fa97 100644
--- a/src/libopts/text_mmap.c
+++ b/src/libopts/text_mmap.c
@@ -186,7 +186,9 @@ validate_mmap(char const * fname, int prot, int flags, tmap_info_t * mapinfo)
* write access.
*/
int o_flag = FILE_WRITABLE(prot, flags) ? O_RDWR : O_RDONLY;
-
+#ifdef _WIN32
+ o_flag |= O_BINARY;
+#endif
/*
* If you're not sharing the file and you are writing to it,
* then don't let anyone else have access to the file.