[3.14] gh-138779: Use the dev_t converter for st_rdev (GH-138780) (#138926)

gh-138779: Use the dev_t converter for st_rdev (GH-138780)

This allows to support device numbers larger than 2**63-1.
(cherry picked from commit 43013f72f0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-10-07 20:36:55 +02:00 committed by GitHub
parent 77b4ed2a37
commit 4bb33ff1c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -2744,7 +2744,7 @@ _pystat_fromstructstat(PyObject *module, STRUCT_STAT *st)
SET_ITEM(ST_BLOCKS_IDX, PyLong_FromLong((long)st->st_blocks));
#endif
#ifdef HAVE_STRUCT_STAT_ST_RDEV
SET_ITEM(ST_RDEV_IDX, PyLong_FromLong((long)st->st_rdev));
SET_ITEM(ST_RDEV_IDX, _PyLong_FromDev(st->st_rdev));
#endif
#ifdef HAVE_STRUCT_STAT_ST_GEN
SET_ITEM(ST_GEN_IDX, PyLong_FromLong((long)st->st_gen));