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

This commit is contained in:
Michael Felt 2018-01-05 13:01:58 +01:00 committed by xdegaye
parent 94459fd7dc
commit 502d551c6d
2 changed files with 7 additions and 0 deletions

View File

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

View File

@ -9336,7 +9336,13 @@ _pystatvfs_fromstructstatvfs(struct statvfs st) {
PyStructSequence_SET_ITEM(v, 8, PyLong_FromLong((long) st.f_flag)); PyStructSequence_SET_ITEM(v, 8, PyLong_FromLong((long) st.f_flag));
PyStructSequence_SET_ITEM(v, 9, PyLong_FromLong((long) st.f_namemax)); PyStructSequence_SET_ITEM(v, 9, PyLong_FromLong((long) st.f_namemax));
#endif #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)); PyStructSequence_SET_ITEM(v, 10, PyLong_FromUnsignedLong(st.f_fsid));
#endif
if (PyErr_Occurred()) { if (PyErr_Occurred()) {
Py_DECREF(v); Py_DECREF(v);
return NULL; return NULL;