Skip to content

Commit 6780c25

Browse files
[libc] Fix utimes build when full_build=OFF
Same as PR llvm#149665: we might pull a header from host where tv_nsec is not a long, so compilation would fail with an implicit conversion error.
1 parent d35931c commit 6780c25

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libc/src/sys/time/linux/utimes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ LLVM_LIBC_FUNCTION(int, utimes,
5959
ts[1].tv_sec = times[1].tv_sec;
6060

6161
// convert u-seconds to nanoseconds
62-
ts[0].tv_nsec = times[0].tv_usec * 1000;
63-
ts[1].tv_nsec = times[1].tv_usec * 1000;
62+
ts[0].tv_nsec = static_cast<decltype(ts[0].tv_nsec)>(times[0].tv_usec * 1000);
63+
ts[1].tv_nsec = static_cast<decltype(ts[1].tv_nsec)>(times[1].tv_usec * 1000);
6464

6565
ts_ptr = ts;
6666
}

0 commit comments

Comments
 (0)