From: Nikos Mavrogiannopoulos Date: Wed, 25 Nov 2015 09:53:51 +0000 (+0100) Subject: libopts: use the O_BINARY flag in windows for files X-Git-Tag: gnutls_3_5_0~524 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c41b8e729b428b3b233fc6aeaa5c5ea37d6436d;p=thirdparty%2Fgnutls.git libopts: use the O_BINARY flag in windows for files --- 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.