summaryrefslogtreecommitdiffstats
path: root/Modules/mmapmodule.c
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-06-14 04:58:16 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-06-14 04:58:16 (GMT)
commit3d8827dab67799ab624c22fa27fa423cb14ace27 (patch)
treee9324f3f60ac8b831b0820f692ded063b14c8eba /Modules/mmapmodule.c
parent077da0e6992e44c1f0dad824458922046a5eff84 (diff)
downloadcpython-3d8827dab67799ab624c22fa27fa423cb14ace27.zip
cpython-3d8827dab67799ab624c22fa27fa423cb14ace27.tar.gz
cpython-3d8827dab67799ab624c22fa27fa423cb14ace27.tar.bz2
Merged revisions 73425 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r73425 | hirokazu.yamamoto | 2009-06-14 12:53:55 +0900 | 2 lines Issue #6271: mmap tried to close invalid file handle (-1) when annonymous. (On Unix) Patch by STINNER Victor. ........
Diffstat (limited to 'Modules/mmapmodule.c')
-rw-r--r--Modules/mmapmodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index fd247ab..37584e2 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -164,7 +164,8 @@ mmap_close_method(mmap_object *self, PyObject *unused)
#endif /* MS_WINDOWS */
#ifdef UNIX
- (void) close(self->fd);
+ if (0 <= self->fd)
+ (void) close(self->fd);
self->fd = -1;
if (self->data != NULL) {
munmap(self->data, self->size);