Closed
Description
In 0.9-pre codeline, fs::stat() returns truncated times.
The problem seems to be in uvio::fs_mkstat(). fs::stat() calls io::fs_lstat() which calls uvio::fs_mkstat(). Its to_msec() converts an C time from uv_timespec_t into Rust time.
struct uv_timespec_t {
tv_sec: libc::c_long,
tv_nsec: libc::c_long
}
tv_sec and tv_nsec are in c_long, which can be 32-bit. to_msec() multiplies tv_sec with 1000, which will truncate the high bits of a large 32-bit time value. tv_sec needs to be casted to u64 before multiplied with 1000 to avoid the truncation problem.
Metadata
Metadata
Assignees
Labels
No labels