Skip to content

Commit 46a62b2

Browse files
committed
add explenation comment to timespec code
1 parent 6e212a3 commit 46a62b2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/tools/miri/tests/pass-dep/libc/libc-time.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ mod test_clock_nanosleep {
360360
fn add_100_millis(mut ts: libc::timespec) -> libc::timespec {
361361
const SECOND: i64 = 1_000_000_000;
362362
ts.tv_nsec += SECOND / 10;
363+
// If this pushes tv_nsec to SECOND or higher, we need to overflow to tv_sec.
363364
ts.tv_sec += ts.tv_nsec / SECOND;
364365
ts.tv_nsec %= SECOND;
365366
ts

0 commit comments

Comments
 (0)