]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
libopts: use the O_BINARY flag in windows for files
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Wed, 25 Nov 2015 09:53:51 +0000 (10:53 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Wed, 25 Nov 2015 09:57:56 +0000 (10:57 +0100)
src/libopts/text_mmap.c

index 07c0bf10ebc3e22c682a4be8a3aa80e158de53e9..d5e074fa9784f0cf2fe6bcac1ac4815de1dc46f3 100644 (file)
@@ -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.