mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-04 11:13:58 +08:00
Static cast to fix conversion error on 32-bit processors
This commit is contained in:
parent
e63a58c5ba
commit
94738c9065
@ -3961,8 +3961,8 @@ GHC_INLINE void last_write_time(const path& p, file_time_type new_time, std::err
|
||||
struct ::timespec times[2];
|
||||
times[0].tv_sec = 0;
|
||||
times[0].tv_nsec = UTIME_OMIT;
|
||||
times[1].tv_sec = std::chrono::duration_cast<std::chrono::seconds>(d).count();
|
||||
times[1].tv_nsec = std::chrono::duration_cast<std::chrono::nanoseconds>(d).count() % 1000000000;
|
||||
times[1].tv_sec = static_cast<decltype(times[1].tv_sec)>(std::chrono::duration_cast<std::chrono::seconds>(d).count());
|
||||
times[1].tv_nsec = static_cast<decltype(times[1].tv_nsec)>(std::chrono::duration_cast<std::chrono::nanoseconds>(d).count() % 1000000000);
|
||||
if (::utimensat(AT_FDCWD, p.c_str(), times, AT_SYMLINK_NOFOLLOW) != 0) {
|
||||
ec = detail::make_system_error();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user