[Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.24,2.24.2.1
Moshe Zadka
moshez@users.sourceforge.net
2001年3月31日 05:23:22 -0800
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv15193/Modules
Modified Files:
Tag: release20-maint
mmapmodule.c
Log Message:
- #128713 - mmapmodule.c - type(mmap_object) blew up on Linux.
- mmap on windows creates a mapping without a name when tagname isn't
specified
Index: mmapmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/mmapmodule.c,v
retrieving revision 2.24
retrieving revision 2.24.2.1
diff -C2 -r2.24 -r2.24.2.1
*** mmapmodule.c 2000年10月01日 17:50:46 2.24
--- mmapmodule.c 2001年03月31日 13:23:19 2.24.2.1
***************
*** 842,848 ****
HANDLE fh = 0;
- /* Patch the object type */
- mmap_object_type.ob_type = &PyType_Type;
-
if (!PyArg_ParseTuple(args,
"iO|z",
--- 842,845 ----
***************
*** 908,912 ****
/* set the tag name */
! if (tagname != NULL) {
m_obj->tagname = PyMem_Malloc(strlen(tagname)+1);
if (m_obj->tagname == NULL) {
--- 905,909 ----
/* set the tag name */
! if (tagname != NULL && *tagname != '0円') {
m_obj->tagname = PyMem_Malloc(strlen(tagname)+1);
if (m_obj->tagname == NULL) {
***************
*** 925,929 ****
0,
m_obj->size,
! tagname);
if (m_obj->map_handle != NULL) {
m_obj->data = (char *) MapViewOfFile (m_obj->map_handle,
--- 922,926 ----
0,
m_obj->size,
! m_obj->tagname);
if (m_obj->map_handle != NULL) {
m_obj->data = (char *) MapViewOfFile (m_obj->map_handle,
***************
*** 963,966 ****
--- 960,967 ----
{
PyObject *dict, *module;
+
+ /* Patch the object type */
+ mmap_object_type.ob_type = &PyType_Type;
+
module = Py_InitModule ("mmap", mmap_functions);
dict = PyModule_GetDict (module);