]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 73427 via svnmerge from
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Sun, 14 Jun 2009 05:16:35 +0000 (05:16 +0000)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Sun, 14 Jun 2009 05:16:35 +0000 (05:16 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r73427 | hirokazu.yamamoto | 2009-06-14 13:58:16 +0900 | 10 lines

  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.
  ........
................

Misc/NEWS
Modules/mmapmodule.c

index 21f54494550197b2dbfa015cf49b2e620c1b6001..bc3f41d2e26a64ae1b01b41f0a9f37bff927303d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -73,6 +73,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #6271: mmap tried to close invalid file handle (-1) when annonymous.
+  (On Unix)
+
 - Issue #6258: Support AMD64 in bdist_msi.
 
 - Fix a bug in the trace module where a bytes object from co_lnotab had its
index 5943a460e81db85d3da23e743dd58eb3714acdb5..ef2b2773b822b8233488fc8111ddda6a85fd197b 100644 (file)
@@ -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);