commit | 7adfad850a50722464775d57b5d16b850ecab56a | [log] [tgz] |
---|---|---|
author | Christian Heimes <christian@cheimes.de> | Fri Feb 15 08:20:11 2008 +0000 |
committer | Christian Heimes <christian@cheimes.de> | Fri Feb 15 08:20:11 2008 +0000 |
tree | 876709cd5987e91a120a0d9af22764663237f9e6 | |
parent | 2f0da53d28b316197a94919c96195a514acc668f [diff] |
Bug #2111: mmap segfaults when trying to write a block opened with PROT_READ Thanks to Thomas Herve for the fix.
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 49fe7f7..e47211f 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c
@@ -1122,6 +1122,10 @@ "mmap invalid access parameter."); } + if (prot == PROT_READ) { + access = ACCESS_READ; + } + #ifdef HAVE_FSTAT # ifdef __VMS /* on OpenVMS we must ensure that all bytes are written to the file */