Skip to content

Commit 4bb33ff

Browse files
[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 43013f7) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 77b4ed2 commit 4bb33ff

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Support device numbers larger than ``2**63-1`` for the
2+
:attr:`~os.stat_result.st_rdev` field of the :class:`os.stat_result`
3+
structure.

Modules/posixmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2744,7 +2744,7 @@ _pystat_fromstructstat(PyObject *module, STRUCT_STAT *st)
27442744
SET_ITEM(ST_BLOCKS_IDX, PyLong_FromLong((long)st->st_blocks));
27452745
#endif
27462746
#ifdef HAVE_STRUCT_STAT_ST_RDEV
2747-
SET_ITEM(ST_RDEV_IDX, PyLong_FromLong((long)st->st_rdev));
2747+
SET_ITEM(ST_RDEV_IDX, _PyLong_FromDev(st->st_rdev));
27482748
#endif
27492749
#ifdef HAVE_STRUCT_STAT_ST_GEN
27502750
SET_ITEM(ST_GEN_IDX, PyLong_FromLong((long)st->st_gen));

0 commit comments

Comments
 (0)