#678250: Make mmap flush a noop on ACCESS_READ and ACCESS_COPY.

Patch by Sébastien Sablé.  This solves a test_mmap failure on AIX.
This commit is contained in:
R. David Murray 2010-10-18 01:14:06 +00:00
parent 051176fde8
commit e194dd60f0
2 changed files with 6 additions and 0 deletions

View File

@ -87,6 +87,8 @@ Library
Extensions
----------
- Issue #678250: Make mmap flush a noop on ACCESS_READ and ACCESS_COPY.
- Issue #9054: Fix a crash occurring when using the pyexpat module
with expat version 2.0.1.

View File

@ -569,6 +569,10 @@ mmap_flush_method(mmap_object *self, PyObject *args)
PyErr_SetString(PyExc_ValueError, "flush values out of range");
return NULL;
}
if (self->access == ACCESS_READ || self->access == ACCESS_COPY)
return PyLong_FromLong(0);
#ifdef MS_WINDOWS
return PyLong_FromLong((long) FlushViewOfFile(self->data+offset, size));
#elif defined(UNIX)