Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit986bb0a

Browse files
authored
gh-83714: Fix stat_nanosecond_timestamp() for 32-bit time_t (#141069)
1 parentf458ac0 commit986bb0a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎Modules/posixmodule.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2634,13 +2634,14 @@ _posix_free(void *module)
26342634
staticPyObject*
26352635
stat_nanosecond_timestamp(_posixstate*state,time_tsec,unsigned longnsec)
26362636
{
2637-
#ifSIZEOF_LONG >=8
2637+
#ifSIZEOF_TIME_T==4
2638+
returnPyLong_FromLongLong(sec*SEC_TO_NS+nsec);
2639+
#else
26382640
/* 1677-09-21 00:12:44 to 2262-04-11 23:47:15 UTC inclusive */
26392641
if ((LLONG_MIN/SEC_TO_NS) <=sec&&sec <= (LLONG_MAX/SEC_TO_NS-1)) {
26402642
returnPyLong_FromLongLong(sec*SEC_TO_NS+nsec);
26412643
}
26422644
else
2643-
#endif
26442645
{
26452646
PyObject*ns_total=NULL;
26462647
PyObject*s_in_ns=NULL;
@@ -2663,6 +2664,7 @@ stat_nanosecond_timestamp(_posixstate *state, time_t sec, unsigned long nsec)
26632664
Py_XDECREF(s_in_ns);
26642665
returnns_total;
26652666
}
2667+
#endif
26662668
}
26672669

26682670
staticint

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp