Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 502d551

Browse files
aixtoolsxdegaye
authored andcommitted
bpo-32390: Fix compilation failure on AIX after f_fsid was added to os.statvfs() (#4972)
1 parent 94459fd commit 502d551

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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.

Modules/posixmodule.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9336,7 +9336,13 @@ _pystatvfs_fromstructstatvfs(struct statvfs st) {
93369336
PyStructSequence_SET_ITEM(v, 8, PyLong_FromLong((long) st.f_flag));
93379337
PyStructSequence_SET_ITEM(v, 9, PyLong_FromLong((long) st.f_namemax));
93389338
#endif
9339+
/* The _ALL_SOURCE feature test macro defines f_fsid as a structure
9340+
* (issue #32390). */
9341+
#if defined(_AIX) && defined(_ALL_SOURCE)
9342+
PyStructSequence_SET_ITEM(v, 10, PyLong_FromUnsignedLong(st.f_fsid.val[0]));
9343+
#else
93399344
PyStructSequence_SET_ITEM(v, 10, PyLong_FromUnsignedLong(st.f_fsid));
9345+
#endif
93409346
if (PyErr_Occurred()) {
93419347
Py_DECREF(v);
93429348
return NULL;

0 commit comments

Comments
 (0)