[Python-checkins] bpo-32390: Fix compilation failure on AIX after f_fsid was added to os.statvfs() (#4972)

xdegaye webhook-mailer at python.org
Fri Jan 5 07:02:05 EST 2018


https://github.com/python/cpython/commit/502d551c6d782963d26957a9e5ff1588946f233f
commit: 502d551c6d782963d26957a9e5ff1588946f233f
branch: master
author: Michael Felt <aixtools at users.noreply.github.com>
committer: xdegaye <xdegaye at gmail.com>
date: 2018-01-05T13:01:58+01:00
summary:

bpo-32390: Fix compilation failure on AIX after f_fsid was added to os.statvfs() (#4972)

files:
A Misc/NEWS.d/next/Core and Builtins/2017-12-22-13-28-07.bpo-32390.QPj083.rst
M Modules/posixmodule.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2017-12-22-13-28-07.bpo-32390.QPj083.rst b/Misc/NEWS.d/next/Core and Builtins/2017-12-22-13-28-07.bpo-32390.QPj083.rst
new file mode 100644
index 00000000000..0e9c1bff540
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2017-12-22-13-28-07.bpo-32390.QPj083.rst	
@@ -0,0 +1 @@
+Fix the compilation failure on AIX after the f_fsid field has been added to the object returned by os.statvfs() (issue #32143). Original patch by Michael Felt.
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 47b79fcc798..b0e48dabbd5 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -9336,7 +9336,13 @@ _pystatvfs_fromstructstatvfs(struct statvfs st) {
     PyStructSequence_SET_ITEM(v, 8, PyLong_FromLong((long) st.f_flag));
     PyStructSequence_SET_ITEM(v, 9, PyLong_FromLong((long) st.f_namemax));
 #endif
+/* The _ALL_SOURCE feature test macro defines f_fsid as a structure
+ * (issue #32390). */
+#if defined(_AIX) && defined(_ALL_SOURCE)
+    PyStructSequence_SET_ITEM(v, 10, PyLong_FromUnsignedLong(st.f_fsid.val[0]));
+#else
     PyStructSequence_SET_ITEM(v, 10, PyLong_FromUnsignedLong(st.f_fsid));
+#endif
     if (PyErr_Occurred()) {
         Py_DECREF(v);
         return NULL;



More information about the Python-checkins mailing list