Skip to content

Commit 5753be4

Browse files
[libc] Fix utimes build when full_build=OFF (#149668)
We might pull a header from the host where tv_nsec is not a long, so compilation would fail with an implicit conversion error.
1 parent 3fd53db commit 5753be4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ 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 =
63+
static_cast<decltype(ts[0].tv_nsec)>(times[0].tv_usec * 1000);
64+
ts[1].tv_nsec =
65+
static_cast<decltype(ts[1].tv_nsec)>(times[1].tv_usec * 1000);
6466

6567
ts_ptr = ts;
6668
}

0 commit comments

Comments
 (0)