Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e194dd6

Browse files
committed
#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.
1 parent 051176f commit e194dd6

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ Library
8787
Extensions
8888
----------
8989

90+
- Issue #678250: Make mmap flush a noop on ACCESS_READ and ACCESS_COPY.
91+
9092
- Issue #9054: Fix a crash occurring when using the pyexpat module
9193
with expat version 2.0.1.
9294

Modules/mmapmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,10 @@ mmap_flush_method(mmap_object *self, PyObject *args)
569569
PyErr_SetString(PyExc_ValueError, "flush values out of range");
570570
return NULL;
571571
}
572+
573+
if (self->access == ACCESS_READ || self->access == ACCESS_COPY)
574+
return PyLong_FromLong(0);
575+
572576
#ifdef MS_WINDOWS
573577
return PyLong_FromLong((long) FlushViewOfFile(self->data+offset, size));
574578
#elif defined(UNIX)

0 commit comments

Comments
 (0)