summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix von Leitner <felix-libowfat@fefe.de>2019-05-07 16:18:59 +0000
committerFelix von Leitner <felix-libowfat@fefe.de>2019-05-07 16:18:59 +0000
commit7208ff99c20dcd8633c572ec2ac899b010a30703 (patch)
treea87b5250737e401e18e5aae10afb042b0a06e7aa
parenta85915ba39c63d4e455270231ccfc4134292d1c9 (diff)
downloadlibowfat-master.tar.gz
libowfat-master.zip
make mmap_private on Windows work on read-only files, tooHEADmaster
-rw-r--r--mmap/mmap_private.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mmap/mmap_private.c b/mmap/mmap_private.c
index 78dfe64..e03fc4d 100644
--- a/mmap/mmap_private.c
+++ b/mmap/mmap_private.c
@@ -12,7 +12,7 @@ char* mmap_private(const char* filename,size_t * filesize) {
#ifdef _WIN32
HANDLE fd,m;
char* map;
- fd=CreateFile(filename,GENERIC_WRITE|GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
+ fd=CreateFile(filename,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
if (fd==INVALID_HANDLE_VALUE)
return 0;
m=CreateFileMapping(fd,0,PAGE_WRITECOPY,0,0,NULL);