diff options
author | Bryan Østergaard <kloeri@gentoo.org> | 2006-02-02 22:23:41 +0000 |
---|---|---|
committer | Bryan Østergaard <kloeri@gentoo.org> | 2006-02-02 22:23:41 +0000 |
commit | 1460b8b1f8fc125262d24b12ac7094181f2ecdf1 (patch) | |
tree | de5213f9a6090474d2ac5cc5550ea634c8abc43e /dev-lang/python | |
parent | Stable on sparc wrt #120840 (diff) | |
download | historical-1460b8b1f8fc125262d24b12ac7094181f2ecdf1.tar.gz historical-1460b8b1f8fc125262d24b12ac7094181f2ecdf1.tar.bz2 historical-1460b8b1f8fc125262d24b12ac7094181f2ecdf1.zip |
Add missing python-2.4.2-mmap+fd.patch.
Package-Manager: portage-2.0.54
Diffstat (limited to 'dev-lang/python')
-rw-r--r-- | dev-lang/python/ChangeLog | 6 | ||||
-rw-r--r-- | dev-lang/python/Manifest | 9 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.4.2-mmap+fd.patch | 161 |
3 files changed, 171 insertions, 5 deletions
diff --git a/dev-lang/python/ChangeLog b/dev-lang/python/ChangeLog index fecefc21d430..31b2f375752b 100644 --- a/dev-lang/python/ChangeLog +++ b/dev-lang/python/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for dev-lang/python # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.186 2006/02/02 21:18:24 kloeri Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.187 2006/02/02 22:23:41 kloeri Exp $ + + 02 Feb 2006; Bryan Østergaard <kloeri@gentoo.org + +files/python-2.4.2-mmap+fd.patch: + Add missing python-2.4.2-mmap+fd.patch. *python-2.4.2-r1 (02 Feb 2006) diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest index 3b88ad3e37eb..7d39ec5d7d82 100644 --- a/dev-lang/python/Manifest +++ b/dev-lang/python/Manifest @@ -1,7 +1,7 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -MD5 f489a7002367b7b9d0e9252b11fb90dd ChangeLog 29862 +MD5 743bb6795aadd151444605d4630baf80 ChangeLog 29994 MD5 7e423c353b08a2c05693d13f21e067d0 files/depreorder-topsort.py 1958 MD5 1c5cd53cb89c821a549968bac31df0f1 files/depreorder.py 2235 MD5 f3f370c8d1382c1a7571cfc1cbb196d9 files/digest-python-2.1.3-r1 62 @@ -48,6 +48,7 @@ MD5 eaa33949f072a9787c453c37c1236108 files/python-2.4.1-db4.patch 1414 MD5 5fdb512b55d4ed9b13a5a3af00a5ba40 files/python-2.4.1-libdir.patch 7875 MD5 47e9455f3e16c3369c9e57388ba3d643 files/python-2.4.1-readline.patch 8984 MD5 5af982af8ad4befbf15567ae399cf2b9 files/python-2.4.1-st_flags.patch 5649 +MD5 bb94b5ecedcbfd85b7ac283b79ff07be files/python-2.4.2-mmap+fd.patch 4920 MD5 73616f083daf8e22a7bff21c4a51678e files/python-2.4.2-no-threads.patch 591 MD5 36b36bac050785b8e393dc72f8e51d2f files/python-2.4.2-readline.patch 8628 MD5 b530d6f9dbcf30239061be3de80932cc files/python-config-2.2 178 @@ -72,7 +73,7 @@ MD5 f9de6829c64c8f780d4c3b90ea5105a9 python-2.4.2.ebuild 9234 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) -iD8DBQFD4ndvugEuf3OQ0akRAmeBAJ9ebJrs59kYCs9Kjjaq0MnQ5M0ghQCfUZ63 -RD7eBPQfSS776DysL62FGpk= -=mzCE +iD8DBQFD4obFugEuf3OQ0akRAsU3AJ98aAyt1bCNj5YslRarR1Kxpa1FLgCdE5V4 +G5tPpzCVq3Yp+E/8rDI0SaQ= +=VCMp -----END PGP SIGNATURE----- diff --git a/dev-lang/python/files/python-2.4.2-mmap+fd.patch b/dev-lang/python/files/python-2.4.2-mmap+fd.patch new file mode 100644 index 000000000000..852dbd3cc379 --- /dev/null +++ b/dev-lang/python/files/python-2.4.2-mmap+fd.patch @@ -0,0 +1,161 @@ +--- Modules/mmapmodule.c.orig 2005-09-20 21:04:42.000000000 +0200 ++++ Modules/mmapmodule.c 2006-02-02 18:50:48.000000000 +0100 +@@ -1,7 +1,7 @@ + /* + / Author: Sam Rushing <rushing@nightmare.com> + / Hacked for Unix by AMK +- / $Id: python-2.4.2-mmap+fd.patch,v 1.1 2006/02/02 22:23:41 kloeri Exp $ ++ / $Id: python-2.4.2-mmap+fd.patch,v 1.1 2006/02/02 22:23:41 kloeri Exp $ + + / mmapmodule.cpp -- map a view of a file into memory + / +@@ -99,6 +99,8 @@ + #endif /* MS_WINDOWS */ + + #ifdef UNIX ++ if (m_obj->fd >= 0) ++ (void) close(m_obj->fd); + if (m_obj->data!=NULL) { + msync(m_obj->data, m_obj->size, MS_SYNC); + munmap(m_obj->data, m_obj->size); +@@ -136,6 +138,8 @@ + #endif /* MS_WINDOWS */ + + #ifdef UNIX ++ (void) close(self->fd); ++ self->fd = -1; + if (self->data != NULL) { + munmap(self->data, self->size); + self->data = NULL; +@@ -370,7 +374,7 @@ + { + unsigned long new_size; + CHECK_VALID(NULL); +- if (!PyArg_ParseTuple (args, "l:resize", &new_size) || ++ if (!PyArg_ParseTuple (args, "k:resize", &new_size) || + !is_resizeable(self)) { + return NULL; + #ifdef MS_WINDOWS +@@ -459,10 +463,10 @@ + static PyObject * + mmap_flush_method(mmap_object *self, PyObject *args) + { +- size_t offset = 0; +- size_t size = self->size; ++ unsigned long offset = 0; ++ unsigned long size = self->size; + CHECK_VALID(NULL); +- if (!PyArg_ParseTuple (args, "|ll:flush", &offset, &size)) { ++ if (!PyArg_ParseTuple (args, "|kk:flush", &offset, &size)) { + return NULL; + } else if ((offset + size) > self->size) { + PyErr_SetString (PyExc_ValueError, +@@ -535,7 +539,7 @@ + { + unsigned long dest, src, count; + CHECK_VALID(NULL); +- if (!PyArg_ParseTuple (args, "iii:move", &dest, &src, &count) || ++ if (!PyArg_ParseTuple (args, "kkk:move", &dest, &src, &count) || + !is_writeable(self)) { + return NULL; + } else { +@@ -859,23 +863,24 @@ + PyObject *map_size_obj = NULL; + int map_size; + int fd, flags = MAP_SHARED, prot = PROT_WRITE | PROT_READ; +- access_mode access = ACCESS_DEFAULT; +- char *keywords[] = {"fileno", "length", +- "flags", "prot", +- "access", NULL}; ++ int access = (int)ACCESS_DEFAULT; ++ static const char *keywords[] = {"fileno", "length", ++ "flags", "prot", ++ "access", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "iO|iii", keywords, +- &fd, &map_size_obj, &flags, &prot, &access)) ++ &fd, &map_size_obj, &flags, &prot, ++ &access)) + return NULL; + map_size = _GetMapSize(map_size_obj); + if (map_size < 0) + return NULL; + +- if ((access != ACCESS_DEFAULT) && ++ if ((access != (int)ACCESS_DEFAULT) && + ((flags != MAP_SHARED) || ( prot != (PROT_WRITE | PROT_READ)))) + return PyErr_Format(PyExc_ValueError, + "mmap can't specify both access and flags, prot."); +- switch(access) { ++ switch((access_mode)access) { + case ACCESS_READ: + flags = MAP_SHARED; + prot = PROT_READ; +@@ -901,15 +906,19 @@ + /* on OpenVMS we must ensure that all bytes are written to the file */ + fsync(fd); + # endif +- if (fstat(fd, &st) == 0 && S_ISREG(st.st_mode) && +- (size_t)map_size > st.st_size) { +- PyErr_SetString(PyExc_ValueError, +- "mmap length is greater than file size"); +- return NULL; ++ if (fstat(fd, &st) == 0 && S_ISREG(st.st_mode)) { ++ if (map_size == 0) { ++ map_size = (int)st.st_size; ++ } else if ((size_t)map_size > st.st_size) { ++ PyErr_SetString(PyExc_ValueError, ++ "mmap length is greater than file size"); ++ return NULL; ++ } + } + #endif + m_obj = PyObject_New (mmap_object, &mmap_object_type); + if (m_obj == NULL) {return NULL;} ++ m_obj->data = NULL; + m_obj->size = (size_t) map_size; + m_obj->pos = (size_t) 0; + m_obj->fd = dup(fd); +@@ -927,7 +936,7 @@ + PyErr_SetFromErrno(mmap_module_error); + return NULL; + } +- m_obj->access = access; ++ m_obj->access = (access_mode)access; + return (PyObject *)m_obj; + } + #endif /* UNIX */ +@@ -943,11 +952,11 @@ + DWORD dwErr = 0; + int fileno; + HANDLE fh = 0; +- access_mode access = ACCESS_DEFAULT; ++ int access = (access_mode)ACCESS_DEFAULT; + DWORD flProtect, dwDesiredAccess; +- char *keywords[] = { "fileno", "length", +- "tagname", +- "access", NULL }; ++ static const char *keywords[] = { "fileno", "length", ++ "tagname", ++ "access", NULL }; + + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "iO|zi", keywords, + &fileno, &map_size_obj, +@@ -955,7 +964,7 @@ + return NULL; + } + +- switch(access) { ++ switch((access_mode)access) { + case ACCESS_READ: + flProtect = PAGE_READONLY; + dwDesiredAccess = FILE_MAP_READ; +@@ -1040,7 +1049,7 @@ + else + m_obj->tagname = NULL; + +- m_obj->access = access; ++ m_obj->access = (access_mode)access; + m_obj->map_handle = CreateFileMapping (m_obj->file_handle, + NULL, + flProtect, |