merge 3.3 (#20594)
authorBenjamin Peterson <benjamin@python.org>
Tue, 11 Feb 2014 15:19:12 +0000 (10:19 -0500)
committerBenjamin Peterson <benjamin@python.org>
Tue, 11 Feb 2014 15:19:12 +0000 (10:19 -0500)
Misc/NEWS
Modules/posixmodule.c

index c9dce279eb82e65229cd33968334326b37990b49..4c0d3a543335b99d895c72e37948af7a5f1ea4af 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -13,6 +13,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #20594: Avoid name clash with the libc function posix_close.
+
 
 What's New in Python 3.4.0 release candidate 1?
 ===============================================
index 71abc9871d2143d3a0b6eb35179aec49ae1d35cd..6cbc78f7b67e3863d9abc745fd831c1922a239cd 100644 (file)
@@ -7763,8 +7763,12 @@ PyDoc_STRVAR(posix_close__doc__,
 "close(fd)\n\n\
 Close a file descriptor (for low level IO).");
 
+/*
+The underscore at end of function name avoids a name clash with the libc
+function posix_close.
+*/
 static PyObject *
-posix_close(PyObject *self, PyObject *args)
+posix_close_(PyObject *self, PyObject *args)
 {
     int fd, res;
     if (!PyArg_ParseTuple(args, "i:close", &fd))
@@ -11422,7 +11426,7 @@ static PyMethodDef posix_methods[] = {
     {"open",            (PyCFunction)posix_open,\
                         METH_VARARGS | METH_KEYWORDS,
                         posix_open__doc__},
-    {"close",           posix_close, METH_VARARGS, posix_close__doc__},
+    {"close",           posix_close_, METH_VARARGS, posix_close__doc__},
     {"closerange",      posix_closerange, METH_VARARGS, posix_closerange__doc__},
     {"device_encoding", device_encoding, METH_VARARGS, device_encoding__doc__},
     {"dup",             posix_dup, METH_VARARGS, posix_dup__doc__},