Skip to content
Snippets Groups Projects
Commit a9e8e40c authored by Per Hedbor's avatar Per Hedbor
Browse files

System.Memory.mmap: If the file cannot be opened in read/write mode, try read only.

parent 0fd41c16
No related branches found
No related tags found
No related merge requests found
...@@ -341,6 +341,9 @@ static void memory__mmap(INT32 args,int complain,int private) ...@@ -341,6 +341,9 @@ static void memory__mmap(INT32 args,int complain,int private)
THREADS_ALLOW(); THREADS_ALLOW();
fd = fd_open(filename,fd_RDWR,0); fd = fd_open(filename,fd_RDWR,0);
if( fd < 0 )
fd = fd_open(filename,fd_RDONLY,0);
if (fd>=0) osize=file_size(fd); if (fd>=0) osize=file_size(fd);
THREADS_DISALLOW(); THREADS_DISALLOW();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment